cancel
Showing results for 
Search instead for 
Did you mean: 

PC reached to HardFault

Vijay Panchal_2
Associate
Posted on August 03, 2017 at 11:42

Hello, I am using Keil uVision V 5.15.

Controller is STM32f070cb.

I am using STM32 discovery board as debugger.

While debugging the device the PC reached to HardFault_Handler in start up file of the controller.

2 REPLIES 2
Posted on August 03, 2017 at 13:29

A Hard Fault handler should be able to determine the instructions causing the fault. Look at the stacked context, and registers, then look at the surrounding instructions against that context.

Other frequent causes of Hard Fault are touching memory inappropriately, or attempting to run ARM 32-bit code, often in external libraries. On the Cortex-M0 watch also for memory alignment faults, it can't load unaligned 32-bit values.

Use a proper Hard Fault Handler to dump the context, and look at the faulting code.

This is a topic I've covered here hundreds of times, please review some of the other threads.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on August 03, 2017 at 13:35

https://community.st.com/0D50X00009XkYYDSA3

https://community.st.com/0D50X00009XkfOXSAZ

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