Quality RTOS & Embedded Software

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


Loading

Howto find a blocked task's whereabouts?

Posted by M Beronius on May 23, 2011
Is there a way to parse the task stack to get to know where a particular task is at a given state?

I have a task that stops executing (comes up as blocked in the task list), and I need to know why/on what it is waiting.

I guess this can be done with the stateviewer, but afaict, I don't have the correct (supported) eclipse environment for stateviewer. (I am using CodeSourcery GCC on Coldfire V2).


RE: Howto find a blocked task's whereabouts?

Posted by Dave on May 23, 2011
The task stack can be inspected, but how things are placed on the stack is very port dependent. You will have to look at the compiler and CPU manuals or the portSAVE_CONTEXT() definition to see where the program counter is saved.

Another option is to use the trace macros to record what that task is doing. You can define the trace macro so it only records information when the pxCurrentTCB is equal to the handle of the task you are interested in.

RE: Howto find a blocked task's whereabouts?

Posted by M Beronius on May 23, 2011
Trace macros may be a way forward (thanks, I have not thought about that!) but as this only happens ever so often, so ideally for me, a post-mortem solution is the preferred way forward here.

There's no other way to know, maybe from the os point of view, what a particular task is blocking on?

Cheers,
Micael

RE: Howto find a blocked task's whereabouts?

Posted by Dave on May 23, 2011
If the task is blocked on a queue or semaphore then the state viewer will give you the queue or semaphore handle, and then you can cross check the handle in the state viewer to get the queue or semaphore name (if the queue or semaphore has been registered).


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


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

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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

Xilinx Microblaze and Zynq partner