2019-07-16 01:55 PM
Hi,
My code is generating a HardFault condition, is not every single time it pass the main loop, but after the first 5s it stops.
The Hardfault not happen every time in the same line, that is what have been so difficult to track down, but it always stops at the address 0x4df94710.
The code is apparent to be fine, I think something is corrupting my stack.
Can someone help me.
Some times happen other hardfault, like:
2019-08-15 07:43 AM
I think there is a back-trace in the top left of post we are responding too. Not super helpful I'm afraid.
Most likely doing a pop { x,y,z, pc } and pulling this 0x3E7D4710 from there. Or bx r2
Could be interrupt based routine, or callback, with a buffer beyond scope.
Without some flow telemetry, or real time trace, might be hard to pin down.
2019-08-15 07:47 AM
Basically, you're going to have to dig to understand what your system is DOING
Hard Faults are gross failures, failures at consistent/repeatable points suggest code or algorithm issues. Random/inconsistent points more to interrupt/call-back.
You're going to need to apply bisection debugging to pin-point or constrain failure to doing or not-doing specific things.
Understand what precipitates the failure, add sanity checks to catch the issue earlier and identify failure paths.