2012-12-16 11:19 AM
Hello!
I've faced with next challenge: my STM32F100C4 freezes right after TIM1 interruption occurs. When I used simulator of Keil (this MCU isn't supported by simulator, so I specified STM32F103C8) I found place in startup file where program freezes: startup_stm32f10x_ld_vl.s <...> ; Dummy Exception Handlers (infinite loops which can be modified) <...> Default_Handler PROC ... EXPORT %name of the peripheria interrupt handler% [WEAK] ... <...list of the interrupt names...>B . <-- this label
ENDP ALIGN Unfortunately, I still don't have any in-circuit debugger so I can diagnose something with one LED flashing or simulation result. What can be a cause of this freezing? #stm32f100c4-tim12012-12-16 12:07 PM
I think you use default handler, ''b .'' may be just infinite loop like ''while(1);''
You need to write your handler to service the irq.2012-12-16 12:10 PM
What can be a cause of this freezing?
One might guess that you don't have a suitably named interrupt hander for the timer interrupt. Either misspelled, or using a C++ compiler? Or that the system in hard faulting and ending up in the while(1) loop.2012-12-17 07:42 PM
knik, handler which I needed is declared and defined...
clive1, I think the name is correct. First time I had written wrong handler name - but compilator cried about error. After that I copied the handler name from an appropriate header file of Keil.
BTW, I remembered that one time I've tried to use TIM6 instead of TIM1 - and got this freezing again. Its handler is coupled with another peripherial handler - like TIM1 handler (TIM1 - witn TIM16, TIM6 - with DAC). Maybe the root of the problem is there?
2012-12-18 01:49 AM
Or, you might have missed to reset the pending flag in the timer interrupt.
This could freeze your application, too.2012-12-18 02:23 AM
Try to check if any vector points to the ''b .'' which is an infinite loop.
It may be default handler or hard fault handler.Also note that TIM1 uses four different vectors.2012-12-18 06:38 AM
DCD TIM1_BRK_IRQHandler ; TIM1 Break
DCD TIM1_UP_IRQHandler ; TIM1 Update DCD TIM1_TRG_COM_IRQHandler ; TIM1 Trigger and Commutation DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare