STM32F100C4, TIM1 problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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-tim1- Labels:
-
TIM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-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.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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.Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-12-17 7: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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-12-18 1:49 AM
Or, you might have missed to reset the pending flag in the timer interrupt.
This could freeze your application, too.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-12-18 2: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.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-12-18 6: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 CompareUp vote any posts that you find helpful, it shows what's working..
