2017-08-03 02:42 AM
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.
2017-08-03 04:29 AM
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.
2017-08-03 04:35 AM
https://community.st.com/0D50X00009XkYYDSA3
https://community.st.com/0D50X00009XkfOXSAZ