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] [May 2011 Threads] 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).
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|