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

hard fault after a while when connected

I'm developing a product using a module with a built-in NRF51822 and I'm experiencing a strange error:

After staying in a connection for a long time (hours to days), the device suddenly enters into the hard fault handler. The system is simple: BLE-Module, Sensor (I2C with bit-banging implementation), battery, button, LCD/LCD-Driver (SPI). Every 1s the sensor data is read and the characteristics are updated (and usually notified).

I back-traced the instruction causing the hard fault to the addresses 0x0000B65F and 0x0000B5E1 when using the softdevice S110 7.0.0 or S110 7.1.0. This seems to be somewhere in the Softdevice area where I have no source or Debug possibilities.

I am using the ARM mbed library and BLE_API. The Stack-/Heappointers don't change during the established connection and the hard fault occurs outside of my application/periodic callback (both verified through debug messages) so there should not be a problem with nested interrupts or similar I guess.

Because the error occurs outside of my application it's very hard for me to debug and find the root cause. But I have tried several things and one lead to a decreased chance of the error to happen (from >80% failure chance after two days to <20%) :

  • Not using the Hardware SPI and use a bit-banged implementation instead.

Following actions had no influence:

  • not using the sd_flash api calls
  • not updating characteristics
  • compiler optimization level
  • used memory model (2 region or 1 region)
  • softdevice version 7.0.0 or 7.1.0

Does someone has any idea what might be the cause here or what else I could try? Especially if the Nordic guys have some information about what happens @ 0x0000B65F / 0x0000B5E1?

Thanks

Parents
  • Thanks! I haven't documented with which Softdevice Version each of these instructions were causing the hard-fault. But I will try to separate these the next days with a known softdevice version and an attached debugger. edit: I tried to catch the stack assert from mbed with a brakepoint, but it was not hit. But I will take a closer look there as well. Right now I have two devices running on a debugger, one with 7.0.0 and the other with 7.1.0. As soon as I have results I will share them to you. Thanks!

Reply
  • Thanks! I haven't documented with which Softdevice Version each of these instructions were causing the hard-fault. But I will try to separate these the next days with a known softdevice version and an attached debugger. edit: I tried to catch the stack assert from mbed with a brakepoint, but it was not hit. But I will take a closer look there as well. Right now I have two devices running on a debugger, one with 7.0.0 and the other with 7.1.0. As soon as I have results I will share them to you. Thanks!

Children
No Data
Related