2017-11-30 07:30 PM
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.
Best Regards,
Kent
#openstm32-debug #driver-versionSolved! Go to Solution.
2017-11-30 07:57 PM
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.
2017-11-30 07:57 PM
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.
2017-11-30 10:40 PM
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