Skip to content
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

latency_measure@mimxrt1050_evk meets hard fault for R1.13 RC1 #9650

Closed
hakehuang opened this issue Aug 27, 2018 · 3 comments
Closed

latency_measure@mimxrt1050_evk meets hard fault for R1.13 RC1 #9650

hakehuang opened this issue Aug 27, 2018 · 3 comments
Assignees
Labels
area: ARM ARM (32-bit) Architecture area: Kernel area: Tests Issues related to a particular existing or missing test bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Milestone

Comments

@hakehuang
Copy link
Collaborator

hakehuang commented Aug 27, 2018

build the application at tests/benchmarks/latency_measure, with below steps:
'cmake -DBOARD=mimxrt1050_evk ..
download to board, the console output below message

> ======== Target Main Serial Content:   ========
tthread ID = 0x20000344start application at 0x28cd !!!

***** Booting Zephyr OS 1.13.0-rc1 *****

***** HARD FAULT *****

  Fault escalation (see below)

***** USAGE FAULT *****

  Unaligned memory access

***** Hardware exception *****

Current thread ID = 0x2000021c

Faulting instruction address = 0x15e2

Fatal fault in thread 0x2000021c! Aborting.
@hakehuang hakehuang added area: Kernel area: ARM ARM (32-bit) Architecture labels Aug 27, 2018
@hakehuang
Copy link
Collaborator Author

cc @MaureenHelm

@hakehuang hakehuang added bug The issue is a bug, or the PR is fixing a bug area: Tests Issues related to a particular existing or missing test labels Aug 27, 2018
@MaureenHelm MaureenHelm self-assigned this Aug 27, 2018
@MaureenHelm MaureenHelm added the priority: medium Medium impact/importance bug label Aug 27, 2018
@MaureenHelm
Copy link
Member

I'm not able to reproduce this. I got the following console output:

***** Booting Zephyr OS v1.13.0-rc1 *****
|-----------------------------------------------------------------------------|
|                            Latency Benchmark                                |
|-----------------------------------------------------------------------------|
|  tcs = timer clock cycles: 1 tcs is 1 nsec                                  |
|-----------------------------------------------------------------------------|
| 1 - Measure time to switch from ISR back to interrupted thread              |
| switching time is 162 tcs = 270 nsec                                        |
|-----------------------------------------------------------------------------|
| 2 - Measure time from ISR to executing a different thread (rescheduled)     |
| switch time is 234 tcs = 390 nsec                                           |
|-----------------------------------------------------------------------------|
| 3 - Measure average time to signal a sema then test that sema               |
| Average semaphore signal time 79 tcs = 131 nsec                             |
| Average semaphore test time 33 tcs = 55 nsec                                |
|-----------------------------------------------------------------------------|
| 4- Measure average time to lock a mutex then unlock that mutex              |
| Average time to lock the mutex 98 tcs = 163 nsec                            |
| Average time to unlock the mutex 87 tcs = 145 nsec                          |
|-----------------------------------------------------------------------------|
| 5 - Measure average context switch time between threads using (k_yield)     |
| Average thread context switch using yield 174 tcs = 291 nsec                |
|-----------------------------------------------------------------------------|
| 6 - Measure average context switch time between threads (coop)              |
| Average context switch time is 186 tcs = 311 nsec                           |
|-----------------------------------------------------------------------------|
===================================================================
PROJECT EXECUTION SUCCESSFUL

Can you try doing a pristine build or POR-ing the board? I've seen the jlink connection occasionally get corrupted on this board.

@nashif nashif added this to the v1.13.0 milestone Aug 28, 2018
@hakehuang
Copy link
Collaborator Author

hakehuang commented Aug 28, 2018

@MaureenHelm the reproduce steps at my side is to copy the binary to TCM and jump to that entry address. and seeing from the log the zephyr application runs, but the structure seems has possible unalinged access issue see below structure

> struct

 sys_mem_pool_base {
        void *buf;
        size_t max_sz;
        u16_t n_max;
        u8_t n_levels;
        u8_t max_inline_level;
        struct sys_mem_pool_lvl *levels;
        u8_t flags;
};

the code hard fault at address

> static

 int get_bit_ptr(struct sys_mem_pool_base *p, int level, int bn,
                       u32_t **word)
{
        u32_t *bitarray = level <= p->max_inline_level ?
                &p->levels[level].bits : p->levels[level].bits_p;

        *word = &bitarray[bn / 32];

        return bn & 0x1f;
}

see below debug assembly comparison screen shot
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ARM ARM (32-bit) Architecture area: Kernel area: Tests Issues related to a particular existing or missing test bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
None yet
Development

No branches or pull requests

3 participants