Skip to content

tests/benchmarks/timing_info faults on ARM platforms #10515

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nniranjhana opened this issue Oct 11, 2018 · 2 comments
Closed

tests/benchmarks/timing_info faults on ARM platforms #10515

nniranjhana opened this issue Oct 11, 2018 · 2 comments
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug priority: high High impact/importance bug

Comments

@nniranjhana
Copy link

The time measurement test passes but runs into couple of USAGE FAULTS and hardware exceptions before that.

Arch: ARM
Platforms: sam_e70_xplained, nrf52_pca10040, nrf52840_pca10056, frdm_k64f

Error log on console:

 ***** delaying boot 1000ms (per build configuration) *****
 ***** Booting Zephyr OS 1.13.99 (delayed boot 1000ms) *****
 starting test - Time Measurement
 Timing Results: Clock Frequency: 300 MHz
 Context switch                               :4128 cycles , 13760 ns
 Tick overhead                                :1964 cycles ,  6546 ns
 Thread Creation                              :3858 cycles , 12860 ns
 Thread cancel                                :2810 cycles ,  9366 ns
 Thread abort                                 :7576 cycles , 25253 ns
 Thread Suspend                               :5434 cycles , 18113 ns
 Thread Resume                                :5896 cycles , 19653 ns
 Thread Yield                                 :4898 cycles , 16326 ns
 Thread Sleep                                 :5602 cycles , 18673 ns
 Heap Malloc                                  :3738 cycles , 12460 ns
 Heap Free                                    :3108 cycles , 10360 ns
 Semaphore Take with context switch           :6220 cycles , 20733 ns
 Semaphore Give with context switch           :6672 cycles , 22240 ns
 Semaphore Take without context switch        : 498 cycles ,  1660 ns
 Semaphore Give without context switch        :1050 cycles ,  3500 ns
 Mutex lock                                   :1177 cycles ,  3923 ns
 Mutex unlock                                 :1472 cycles ,  4906 ns
 Message Queue Put with context switch        :7056 cycles , 23520 ns
 Message Queue Put without context switch     :1312 cycles ,  4373 ns
 Message Queue get with context switch        :7518 cycles , 25060 ns
 Message Queue get without context switch     :1370 cycles ,  4566 ns
 MailBox synchronous put                      :7820 cycles , 26066 ns
 MailBox synchronous get                      :7454 cycles , 24846 ns
 MailBox asynchronous put                     :1732 cycles ,  5773 ns
 MailBox get without context switch           :3296 cycles , 10986 ns
 
 ***** USAGE FAULT *****
   Attempt to execute undefined instruction
   
 ***** Hardware exception *****
 Current thread ID = 0x20404050
 Faulting instruction address = 0x407a46
 Fatal fault in thread 0x20404050! Aborting.
 User thread Creation                         :9016 cycles , 30053 ns
 
 ***** USAGE FAULT *****
   Attempt to execute undefined instruction

 ***** Hardware exception *****
 Current thread ID = 0x20404050
 Faulting instruction address = 0x407a46
 Fatal fault in thread 0x20404050! Aborting.
 Validation overhead k object init            :1388 cycles ,  4626 ns
 Validation overhead k object permission      :1171 cycles ,  3903 ns
 Timing Measurement  finished
 
 PASS - main
 ===================================================================
 ===================================================================
 PROJECT EXECUTION SUCCESSFUL
@nashif nashif added bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug labels Oct 11, 2018
@MaureenHelm
Copy link
Member

The test fails only with prj_userspace.conf, starting with commit 8ce758a

8ce758a8ff1b21e4ce131c79c13f070089418d32 is the first bad commit
commit 8ce758a8ff1b21e4ce131c79c13f070089418d32
Author: Daniel Leung <[email protected]>
Date:   Mon Oct 8 10:43:07 2018 -0700

    linker: warn about orphan sections
    
    This adds a linker flag and necessary changes to linker scripts
    so that linker will warn about orphan sections.
    
    Relates to #5534.
    
    Signed-off-by: Daniel Leung <[email protected]>

@dcpleung
Copy link
Member

dcpleung commented Oct 12, 2018

I tried it out with QEMU 3 and board mps2_an385, and there were multiple USAGE FAULTs with commit 8ce758a. I re-ran against master (d696a56) and there were no more USAGE FAULTs. I think commit 4f78d86 fixed this issue already.

@nashif nashif added priority: high High impact/importance bug and removed priority: medium Medium impact/importance bug labels Oct 14, 2018
dcpleung pushed a commit to dcpleung/zephyr that referenced this issue Oct 19, 2018
This puts the priviledged stack at the end of RAM.
This combines PR zephyrproject-rtos#10507 and zephyrproject-rtos#10542.

Fixes zephyrproject-rtos#10473
Fixes zephyrproject-rtos#10474
Fixes zephyrproject-rtos#10515

Signed-off-by: Adithya Baglody <[email protected]>
Signed-off-by: Daniel Leung <[email protected]>
dcpleung added a commit to dcpleung/zephyr that referenced this issue Oct 19, 2018
(Previous patch set was reverted due to issue with priv_stack.
 Resubmitting after fixing the faults caused by priv_stack.noinit
 not at the end of RAM.)

This adds a linker flag and necessary changes to linker scripts
so that linker will warn about orphan sections.

Relates to zephyrproject-rtos#5534.

Fixes zephyrproject-rtos#10473, zephyrproject-rtos#10474, zephyrproject-rtos#10515.

Signed-off-by: Daniel Leung <[email protected]>
@nashif nashif closed this as completed in 1fa8cf9 Oct 19, 2018
nashif pushed a commit that referenced this issue Oct 19, 2018
(Previous patch set was reverted due to issue with priv_stack.
 Resubmitting after fixing the faults caused by priv_stack.noinit
 not at the end of RAM.)

This adds a linker flag and necessary changes to linker scripts
so that linker will warn about orphan sections.

Relates to #5534.

Fixes #10473, #10474, #10515.

Signed-off-by: Daniel Leung <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug priority: high High impact/importance bug
Projects
None yet
Development

No branches or pull requests

4 participants