cancel
Showing results for 
Search instead for 
Did you mean: 

SW enter HardFault_Handler using OpenStm32

kent gu
Associate III
Posted on December 01, 2017 at 04:30

Hi,

The project is developed with Keil MDK, it run well. But I use OpenStm32 to create one project, and copy the source code into the OpenStm32 project. I can run with ST Jlink V2, but the code enter HardFault_Handler while run ''TIM_Cmd(TIM4,ENABLE); ''. 

BTW, I use old stm32f10x_it.c (V3.3.0) version?other driver file are old version.

0690X00000604HZQAY.jpg

Best Regards,

Kent

#openstm32-debug #driver-version
1 ACCEPTED SOLUTION

Accepted Solutions
Posted on December 01, 2017 at 04:57

Need to make sure you have a TIM4 IRQ Handler set up.

Check also the reason of the Hard Fault, having it as a while(1) loop isn't very enlightening.

Check also for uninitialized pointers, or code in the TIM4_IRQHandler that does a division, this can trap if you divide by zero, so check before doing the math.

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

View solution in original post

2 REPLIES 2
Posted on December 01, 2017 at 04:57

Need to make sure you have a TIM4 IRQ Handler set up.

Check also the reason of the Hard Fault, having it as a while(1) loop isn't very enlightening.

Check also for uninitialized pointers, or code in the TIM4_IRQHandler that does a division, this can trap if you divide by zero, so check before doing the math.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on December 01, 2017 at 06:40

Clive,

Thank you a lot for your reminder. Yes, seems that I import wrong startup file, which not include Tim4  vector. I solved the problem with the correct startup file.

Best Regards,

Kent