Skip to main content
kent gu
Associate III
December 1, 2017
Solved

SW enter HardFault_Handler using OpenStm32

  • December 1, 2017
  • 2 replies
  • 894 views
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
This topic has been closed for replies.
Best answer by Tesla DeLorean
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.

2 replies

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
December 1, 2017
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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
kent gu
kent guAuthor
Associate III
December 1, 2017
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