Hard fault debugging on Boron: How-To?

I have a problem with a custom firmware running on several Borons. The devices reboot after random uptimes from 1-40h. The reset reason is 130/RESET_REASON_PANIC with resetReasonData 1 (Hard fault). This happens on several devices.

The Borons are doing nothing while the hardfault happens (except for checking some flags in the main loop which are always false due to missing bluetooth interaction). I tried removing parts from the firmware to find the cause, but this is not really possible without bigger changes due to everything depending on each other.
Whenever I make a bigger change, the hardfault disappears. I got I even to disappear by changing the order of some lines, but later, when editing code somewhere else, it reappeared.
This means after changing code, it is impossible to say if the hardfault disappeared because it was caused by the changed code or if it disappeared just by changing anything. In the second case, it can reappear every time.

The annoying about this problem is that I have to wait for >40h uptime to be sure the hardfault is gone. This makes searching very slow.

I have a Particle Debugger here. But compiling the firmware for debugging throws

arm-none-eabi/bin/ld.exe: region `APP_FLASH' overflowed by 18434 bytes
collect2.exe: error: ld returned 1 exit status

What else can I do to find the source of this hardfault?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.