It is just a simple test. The timer will trigger a task every 20ms. But the led never becomes on. I have tried every method I can found but I still can't figure it out what wrong with it. Please help me. Thank you very much.
OS_TID LED_Task; __task void Task_LED(void) { while(1){ os_evt_wait_or(0x0001, 0xffff); LED2_ON(); } } __task void init_task (void) { LED_Task = os_tsk_create(Task_LED,2); TIM_Cmd(TIM2, ENABLE); os_tsk_delete_self (); } void TIM2_IRQHandler(void) { isr_evt_set(0x0001,LED_Task); }
I forgot these information: MDK V4.54 with STM32F103RBT6
And I'm sure the interrupt routine is called since it can stop at a breakpoint inside interrupt routine in debug mode.
So - who is initializing the GPIO pin as an output? And who is responsible for turning off the LED?
I'm sure everything is working fine since if I use os_evt_set() in another task and it works fine. The problem is the task_led just stuck at waiting the interrupt routine sending the event while the interrupt do send the event.
I updated my keil from 4.54 to 4.70a and it works now!!! Too strange...