cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f405, hardfault help

Angelo1
Associate II
Posted on March 18, 2014 at 19:38

Dear all,

i am still in a beginner phase with stm32, and trying to output a square wave from a GPIO PORTA pin.

But program loops in hardfault:

> step

target state: halted

target halted due to single-step, current mode: Thread

xPSR: 0x41000000 pc: 0x0800224c msp: 0x20020000

halted: PC: 0x0800224c

> step

target state: halted

target halted due to single-step, current mode: Handler HardFault

xPSR: 0x41000003 pc: 0x08000900 msp: 0x2001ffe0

halted: PC: 0x08000900

> step

target state: halted

target halted due to single-step, current mode: Handler HardFault

xPSR: 0x41000003 pc: 0x08000902 msp: 0x2001ffe0

halted: PC: 0x08000902

> step

target state: halted

target halted due to single-step, current mode: Thread

xPSR: 0x41000000 pc: 0x0800224c msp: 0x20020000

halted: PC: 0x0800224c

>

What could cause this ?

Thanks

angelo

#hard-fault
2 REPLIES 2
Posted on March 18, 2014 at 20:01

You'd need to examine the code at the faulting address, and the register content to understand what is failing.

You are probably writing to an illegal memory address

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Andrew Neil
Evangelist III
Posted on March 18, 2014 at 22:25

Debugging Cortex-M Hard Faults

Take a look at the links & info here:

http://community.arm.com/thread/5414

Covers Cortex-M0, Cortex-M0+, Cortex-M3, Cortex-M4