Hi I have a problem that it takes a long time to resume a task when i call ”xTaskResumeFromISR” from within a interrupt. It takes at least 7ms from that I call ”xTaskResumeFromISR” to that the task starts executing. The delay time slowly increases to over 100ms.
If i call vTaskResume from another task the task resumes immediately. I only have one interrupt on and only one other task that only contains a while loop and vTaskDelay(100/portTICK
RATEMS);. (if I don’t have another task I can’t run the program for some reason)
program:
main:
{
xTaskCreate( taskB, ( signed char * ) “taskB”, configMINIMAL
STACKSIZE, NULL, 2, NULL );
xTaskCreate( CAN
ControlTask, ( signed char * ) “C
Control”, configMINIMALSTACK_SIZE, NULL, 1, &canHandle );
// FreeRTOS start
vTaskStartScheduler();
}
void CAN
ControlTask( void* pdata )
{
CAN
Config();
while (1)
{
CANReceiveRoutine();
vTaskSuspend( NULL );
// ulTaskNotifyTake( pdTRUE, (10000/portTICK
RATEMS) );
}
}
void CAN
RXInterrupt( void )
{
BaseType_t xHigherPriorityTaskWoken = pdTRUE;
IO_OkStatusLedOn();
if (CAN_GetITStatus(CANx, CAN_IT_FMP0) != RESET)
{
.......................................
xTaskResumeFromISR( canHandle );
// vTaskNotifyGiveFromISR( canHandle , &xHigherPriorityTaskWoken );
CAN_ClearITPendingBit(CANx, CAN_IT_FMP0);
}
}
Does anyone know why this happens and how to fix it?
Same thing happens when I use “ulTaskNotifyTake” and “vTaskNotifyGiveFromISR”
When I run my program In CoOS I don’t get this problem.
Info about platform: MCU: stm32f407: IDE: coocox 2.0.3. toolchain: gcc 4.8 2004. RTOS: FreeRTOS V8.2.2