cancel
Showing results for 
Search instead for 
Did you mean: 

How to diagnose a Hard Fault Exception on STM32F407IGT

SMali.3
Associate III

Hello

After running the code for about one to two hours I always get Hard Fault exception. Readout of the registers in this Hard Fault while loop are:

HFSR=0x4000 0000

CFSR=0x8200

BFAR=0x20020000

MMFAR=0x20020000

AFSR=0

 

Readout of the SP register shows:

SP=0x2001ff40

*(SP)=8

*(SP-1)=8

*(SP-2)=1

*(SP-3)=2

*(SP-4)=2

*(SP-5)=2

*(SP-6)=0

*(SP-7)=0

*(SP-8)=0x2001ffc0

*(SP-9)=0x8012ae8

What is going on here? How to make a proper recovery from this situation?

 

12 REPLIES 12
BarryWhit
Lead II

Are you sure it was EMI?  excessive switching noise on the SMPS output could also cause glitches for example.

- If someone's post helped resolve your issue, please thank them by clicking "Accept as Solution".
- Please post an update with details once you've solved your issue. Your experience may help others.

I assume that is EMI because the power supply in question had no direct connection with the micro-controller except for the ground. Micro-controller is supplied from another SMPS which works fine with the component for more than a decade.

I did not measure with the spectrum analyzer because of lack of time. Maybe I will do that at some point in the future.

Fair. Would have been interesting to verify by shielding with an improvised can and seeing if the issue went away. 

- If someone's post helped resolve your issue, please thank them by clicking "Accept as Solution".
- Please post an update with details once you've solved your issue. Your experience may help others.