Hi
I have a task that I resume from an interrupt. After some time (10 minutes too several hours) the task that gets resumed from the interrupt stop executing. This while all other tasks continues to function normally.
When I call vTaskList() after the task have stopped working the effected task does not appear in the list anymore.
vTaskList() before CAN_T task stops executing:
Name State Priority Stack Num
Shell_T R 5 300 4
CAN_T R 1 428 3
IDLE R 0 491 6
IR_T B 3 482 2
Error_T B 6 483 5
Main_T B 2 460 1
Tmr Svc B 2 993 7
vTaskList() after CAN_T task stops executing:
Name State Priority Stack Num
Error_T R 6 483 5
IDLE R 0 491 6
Shell_T B 5 300 4
IR_T B 3 477 2
Main_T B 2 460 1
Tmr Svc B 2 993 7
I don’t think its stack overflow because I don’t end up in the vApplicationStackOverflowHook() and there seems to be plenty of memory still available when I call vTaskList() before the task stops working. I also don’t get caught in the configASSERT .
Anyone having a clue what could be wrong here?
Why does the task disappear from the vTaskList()?
Info about platform: MCU: stm32f407: IDE: coocox 2.0.3. toolchain: gcc 4.8 2004. RTOS: FreeRTOS V8.2.2
If you are using the task suspend/resme mechanism to synchronise a task with an interrupt, then please don’t, it is a dangerous technique to use. Please read the documentation page of the xTaskResumeFromISR(), and other posts in this forum where people have experienced the same issue.
Thank you for the reply!
I have tried using the vTaskNotifyGiveFromISR( canHandle, NULL ) but the program only runs for a couple of minutes before it ends up in the HardFault_Handler().
If I don’t call the portYIELD_FROM_ISR( pdTRUE ) the program seems to work fine but the task is not started directly after the interrupt and that is not acceptable.
I don’t know why I get this problem but I guess it might have something with the interrupt priority settings. But as I understand it I think the settings are correct.
The interrupt priority for the interrupt calling vTaskNotifyGiveFromISR() and portYIELD_FROM_ISR() is the following:
Anyone having a clue of why I end up in hard fault when I use vTaskNotifyGiveFromISR and portYIELD_FROM_ISR from an interrupt? Or how I investigate further how to track down the fault?