cancel
Showing results for 
Search instead for 
Did you mean: 

HardFault on STM32F765

Luiz Roque
Associate II

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.

0690X000009YoaXQAS.png

Some times happen other hardfault, like:

0690X000009YoamQAC.png

11 REPLIES 11

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..