Re: Random fault exception.

Andrei Gansari

Hello Antoine,


It looks similar to:


I suspect it’s related to CONFIG_CODE_DATA_RELOCATION; also “by adding ad "printk()", adding variable, changing a configuration” sounds like a caching issue.

How does you application look like? Please provide more details.

Are you running the following ‘zephyr/samples/application_development/code_relocation/’ ?

Are you using a different medium to store code (other than onboard flash/itcm, i.e. sd card)?


When running try -DCONFIG_NO_OPTIMIZATIONS=y to generate O0 code, you may have a call stack to find the source of your crash. (If the issue still reproduces in O0).





From: users@... <users@...> On Behalf Of Antoine Zen-Ruffinen via Lists.Zephyrproject.Org
Sent: Wednesday, March 27, 2019 1:14 PM
To: users@...
Cc: users@...
Subject: [Zephyr-users] Random fault exception.




I have stared using Zephyr few week back on MIXMRT1050-EVKB and I am enjoying it. However, I am currently facing an issue that I have trouble to sort out. This might be a bug, but I am not sure a this point. From time to time, my code run into hard-fault exception or an other exception. For instance I have the following report in the console:


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

  Illegal use of the EPSR

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

Current thread ID = 0x80000f44

Faulting instruction address = 0x4346

Fatal fault in thread 0x80000f44! Aborting.



In this report, the "faulting instruction address" is likely wrong at the application is linked to Flash at 0x60000000 and RAM at 0x80000000. Also, I was not able to find any instruction using the xPSR register in the code area where the fault append.


The strange is that if I modify the code is any way, by adding ad "printk()", adding variable, changing a configuration option or other way (event in code section that are not run before the crash), the error is gone for a while then re-appears suddenly upon a future code change. Also if I debug my code and do instruction stepping, the error does not occurs.


I have tried to investigate many thing, like comparing disassembly of working and crashing program, debugging to find the faulty instruction, increase of stack size, etc with no luck.


I'm not 100% sure this is related to Zephyr itself, but I an developing on ARM Cortex-M since a while now and I never seen something like this. Worth to mention that I use the CONFIG_CODE_DATA_RELOCATION option.


Anybody has a seen this before ? Any leads that I can follow ? Would be greatly appreciated!


Thanks! Regards,





Join to automatically receive all group messages.