FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [July 2016 Threads] Task States (in IAR plugin)Posted by valeriv on July 25, 2016 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)Posted by edwards3 on July 25, 2016 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)Posted by valeriv on July 26, 2016 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)Posted by westmorelandeng on July 26, 2016 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)Posted by valeriv on July 26, 2016 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)Posted by westmorelandeng on July 26, 2016 Hello Valerie,
What do you see if you put a breakpoint on DoSomething();?
Regards,
John W.
Task States (in IAR plugin)Posted by valeriv on July 26, 2016 If breakpoint on DoSomething() and I stoped there, so this Task on RUNNING state
Task States (in IAR plugin)Posted by valeriv on July 27, 2016 One more question about task states:
I use xEventGroupSetBits(), If it set the task to BLOCKED state ?
Task States (in IAR plugin)Posted by rtel on July 27, 2016 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)Posted by valeriv on July 28, 2016
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|