Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

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.

Attachments

alternate (724 bytes)

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.

Attachments

alternate (655 bytes)

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

Tank you very much.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS