This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Help with hardfault analysis

Hi, looking for some advice regarding hardfault analysis.

Using NRF52840 with SDK 15.3 and SD 6.1.0, i am seeing occasional hard fault (after ~30 min to 2 hours), during relatively low traffic period. I am connected to an ipad. I update a status charactersitics at regular interval, and the ipad reads it at a regular interval.

I am seeing a hard-fault with the following message:

<error> hardfault: HARD FAULT at 0x0002565A
<error> hardfault: R0: 0x200018A0 R1: 0x000FFFFF R2: 0x00000012 R3: 0x00000003
<error> hardfault: R12: 0x00000003 LR: 0x0000DCD5 PSR: 0x2100000B
<error> hardfault: Cause: Data bus error (PC value stacked for the exception return points to the instruction that caused the fault).
<error> hardfault: Bus Fault Address: 0x000FFFFF

Application code starts at 0x26000 and RAM slave 0 and 1 are reserved for SD (0x20000000 to 0x20004000)

From what I am reading, LR indicates that the hardfault is occuring from within the softdevice, caused by executing code in location reserved by memory. Would appreciate help analysing whether this is likely a SD bug, application bug causing SD to hardfault, or something else.

  • There are many possible causes.  The usual one was because somewhere in your code there is a interrupt at priority highest.  The SD requires to have highest priority.  Other is when your interrupt processing is taken to long causing the SD to miss fire its timing.  In resume, anything that block the SD is likely to cause the hard fault.

Related