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

Hard Fault hang in BLE stack

I have a nicely working application that occasionally hangs. I have managed to trap a "hard fault" under the debugger (using VS with GCC). I have the system halted with the debugger open, but can't find a way to trace further to see what precipitated the fault. Where do I go from here?

Parents
  • Hi, 

    I think the easiest way to back trace a hard fault is to use the Hardfault library provided in the SDK (link). Which SDK version are you on?

    That said, this won't work if the program is stuck in the softdevice's hardfault handler. Generally it should forward all fault exceptions to the application, but it can fail in some rare cases as mentioned in this thread or if you have "vector catch" enabled in GDB (probably vector catch if PC is below address 0x1000).  

Reply
  • Hi, 

    I think the easiest way to back trace a hard fault is to use the Hardfault library provided in the SDK (link). Which SDK version are you on?

    That said, this won't work if the program is stuck in the softdevice's hardfault handler. Generally it should forward all fault exceptions to the application, but it can fail in some rare cases as mentioned in this thread or if you have "vector catch" enabled in GDB (probably vector catch if PC is below address 0x1000).  

Children
No Data
Related