Random hardfault bug with STM32F730
We are struggling with mysterious bug with our STM32F730 project, even the bug itself is not easy to explain.
We use FreeRTOS and our code is run XIP from QSPI FLASH SST26VF016B.
IDE used is Atollic version: 9.1.0.
The problem is that the application crashes to hardfault vector, but not always.
We sometimes can build the binary which runs perfectly for hours or "forever". But if we add randomly line of code somewhere the binary crashes within random time: in seconds, minutes or hours - not even nearby the line where the code was added.
When debugging the problem, one build always crashes at about the same place and another build in totally different place. There seems to be nothing common in between these places.
With debugger we can have the LR, SP and PC values to the place where the hardfault occurs, but that is no helpful: those points to the code in which there's nothing wrong and which has already been run thousands of times before suddenly crashing.
Debug trace usually shows the last Signal handler called addressees 0xFFFFFFF1 or 0xFFFFFFFD. The problem seems to be somehow asynchronous, related maybe to interrupts.
We do have the simple test software build with the same drivers and it has never crashed, although it is using the same interfaces: SPI, three UARTS, AD, floating point calculations.
We have tried SW and HW floating points, different QSPI speeds and different compiler options.
What we would need is to have some trace of code flow just before the hardfault occurs, but we can't put a brakepoint anywhere in the code.
Does anybody have any hints how to detect the bug? Has anybody encountered similar problems?
