I am running into an issue when I introduce a vTaskDelay to a task everything stops working. If I remove the vTaskDelay from the task, the task executes without any issue. I verified my tick is working properly. I have looked on the forum and I can see a lot of people having similar issues, all contributed to the timer not firing. I checked that my vTickISR is firing and calling xTaskIncrementTick but with a vTaskDelay added to the task, the task is only called once and is never called again...
Has anyone else encountered this? What could be the reasoning.
Thanks in advance.
Maybe the ISR is executing but not calling the FreeRTOS tick handler? When the task stops use the debugger to look at a variable called xTickCount in tasks.c. Does it have a sensible value or is it only 0 or 1?
Yes I checked xTickCount and its incrementing up correctly. I also see that xTaskIncrementTick returns true once for the switch to occur, but then it gets stuck there and all interrupts etc all stop.
I am using a microblaze port so the switch just sets ulTaskSwitchRequested = 1. I also noticed that if I create a xTaskCreateStatic and comment out the ulTaskSwitchRequested from the isr function. The tasks begin to switch correctly... which is very wierd, why would that work?
I am using FreeRTOS9.0 for this.
my vPortTickISR is as follows:
void vPortTickISR( )
if ( cleartimerint(0) == 0 )
/* Increment the RTOS tick - this might cause a task to unblock. /
if( xTaskIncrementTick() != pdFALSE )
/ Force vTaskSwitchContext() to be called as the interrupt exits. */
// ulTaskSwitchRequested = 1;