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

NRF52840 app - random hard fault

Hi,

My application has hard faults sometimes, and I'm trying to figure out the reason.

When it occurs - I have a hard fault log, but p_stack->pc is 0. I can't understand what is the problematic code line.

Do I have another ways to catch the issue?

Thanks!

Parents Reply
  • The hardfault stack frame seems incorrect, that means that wrong stack frame might have been popped into the registers. Which means that some of the stack buffers might have overflowed causing the the next stack frame to get corrupted. 

    Trying disabling logs to see if logs buffers are overflowing (disabling logs should fix the issue if logs buffers are too small for your application). If that does not help, then try to increase the buffer size of modules (in sdk_config.h) one by one to figure out which module's buffer is overflowing. Unfortunately, this could be a tedious debugging session.

Children
Related