Debugging Intermittent Hard Fault on Reset - HELP!
- January 22, 2022
- 5 replies
- 4175 views
We've got code that's been working for months. We updated the HAL Drivers and IDE, and now we got a gremlin. Now we have intermittent hard faults after an external hardware reset, but only when using STMCubeProgrammer (not the IDE) to program the MCU, and seemingly only after a full chip erase before programming. We've instrumented the hardfault handler and we see the attached output when it happens:
So two questions. This output looks very strange, especially the PC being at address 0x2000000. I've tested the tracing code with intentional hard faults, and it works fine, so I think this address is real in some sense.
Second question - does anyone know how to programmatically generate a call stack from the hard fault handler? I've seen posts using gnu Unwind_Backtrace, but none of them have any explanation as to how anything works.
Any help would be greatly appreciated!! We are burning days of time trying to figure this out.
