Task States (in IAR plugin)
Hello
I read in the FreeRTOS documentation that there are 4 States of the tasks : Running, Ready, Blocked and Suspended. But in the IAR (freertos plugin that show running tasks) I see tasks in Running, Ready, Blocked and Delaying states.
I thought that maybe Suspended Delaying states are the same, but the only way to set task to Suspend state is explicitly commanded to do so. And I didn’t set any task to Suspend state explicitly.
So the question what is the Delaying task is ?
Thanks in advance
Valerie
Task States (in IAR plugin)
maybe delayed is a task that is blocked because it called vTaskDelay or vTaskDelayUntil, and blocked is a task that is blocked on a queue or semaphore. Experiment with it to see.
Task States (in IAR plugin)
Yes, you are right – Delaying state appears when I call to vTaskDelay(), also I saw now that Suspended appears after vTaskSuspend.
But now I don’t understand what is Blocked state. I don’t see queues.
What you meen “blocked on a queue” ?
Task States (in IAR plugin)
Hello Valerie,
To see the status of Queues – that needs to be enabled in the FreeRTOS Config file(s) – as an example; a queue can block waiting on information to be sent to it – this is a pretty popular way to handle serial ISR RX routines.
Once that is enabled you will see it in the IAR debugger – of course you need to be using a queue in a task.
HTH,
John W.
Task States (in IAR plugin)
Hi John W.
I use Queues for IPC ( to trransfer messages from task to task ).
But I don’t really understand, if I have task, that it’s main loop include
for(;;)
{
if(mIpcQ->Receive(&message, mblockTime))
{
DoSomething();
}
}
if It mentioned blocked on Queue, and in IAR I see BLOCKED ?
Thanks a lot.
Valerie
Task States (in IAR plugin)
Hello Valerie,
What do you see if you put a breakpoint on DoSomething();?
Regards,
John W.
Task States (in IAR plugin)
If breakpoint on DoSomething() and I stoped there, so this Task on RUNNING state
Task States (in IAR plugin)
One more question about task states:
I use xEventGroupSetBits(), If it set the task to BLOCKED state ?
Task States (in IAR plugin)
All the FreeRTOS objects (queues, event groups, etc.) use the same
Blocking mechanism, so the plug-in will not be able to tell how a
Blocked task got into the Blocked state, and just report the task as
being Blocked. The plug-in can tell the difference between a task that
is blocked on an object and a task not is blocked just to delay for a
fixed period though.
Finding the answer to your questions by experimentation is quite easy –
just call the xEventQueueWaitBits() function, then view the task in the
plug-in to see what state is reported.
Task States (in IAR plugin)
Tank you very much.