cancel
Showing results for 
Search instead for 
Did you mean: 

problem in calling timer interrupt routine

rajivpatil61
Associate II
Posted on December 30, 2014 at 05:19

I am using timer2 and I am trying to generate an interrupt from it, so according to vector table the TIM2 ID is 44 so i  am defining an interrupt routine as

__interrupt(44) void TIM2_IRQHandler()

so why is it not jumping to the routine upon interrupt?

#stm32
4 REPLIES 4
tm3341
Associate II
Posted on December 30, 2014 at 15:35

Enable timer's interrupts, which interrupt on timer, add to NVIC, enable NVIC, etc.

Timer started...

Do you have all these settings?

Posted on December 30, 2014 at 16:55

On what STM32 processor? ST makes dozens of different ones.

On what compiler are you doing this? The templates provided by ST include a startup_stm32fxxx.s file containing a valid vector table with the correct naming of the IRQ Handlers.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
rajivpatil61
Associate II
Posted on December 31, 2014 at 04:34

I'm using stm32f303vc and I'm using Tasking IDE

Posted on December 31, 2014 at 13:38

Sorry no experience with the TASKING tool chain.

44 seems to be a reasonable vector number for the TIM2 Handler

...
112 000000B0 00000000 DCD TIM2_IRQHandler ; TIM2
113 000000B4 00000000 DCD TIM3_IRQHandler ; TIM3
114 000000B8 00000000 DCD TIM4_IRQHandler ; TIM4
...

4 * 44 = 176 = 0xB0 So you'd either need to look how this is done on every other tool chain, or examine what TASKING expects you to do, and how you enable the interrupt on the TIM, and in the NVIC
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..