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] [December 2015 Threads]
Hello!
I have a simple question,
how can I find where my task stack begins in RAM?
I use heap_1.c implementation on dsPIC.
Thanks in advance,
There is currently a feature request, to be implemented for the next release, to provide a function that provides this and other information on the stack of a task. Currently you would have to inspect the task's control block manually.
Regards.
look in the linker map...
On Mon, Dec 7, 2015 at 1:45 PM, Anton antoxaxa@users.sf.net wrote:
Hello!
I have a simple question,
how can I find where my task stack begins in RAM?
I use heap_1.c implementation.
Thanks in advance,
stack location in RAM
Sent from sourceforge.net because you indicated interest in
https://sourceforge.net/p/freertos/discussion/382005/
To unsubscribe from further messages, please visit
https://sourceforge.net/auth/subscriptions/
~~ _/) ~~~~ _/) ~~~~ _/) ~~~~ _/) ~~
Tom Lafleur
Richard wrote:
Currently you would have to inspect the task's control block manually.
In case this is not immediately clear to you:
If you put a break somewhere in tasks.c you can see 'pxCurrentTCB', which points to the Task's Control Block of the task which is currently active.
Two fields in the PCB may be of interest:
~~~~~
StackTypet pxTopOfStack; /* Location of the last item placed on the tasks stack. */
StackTypet pxStack; /* Start of the stack. */
~~~~~
And beside these two members, it might be interesting to check the actual Stack Pointer SP
, which can be found in a window showing the CPU registers.
Lafleur wrote:
look in the linker map...
You will find the location of the stack that will be used at boot time.
For instance, these are 512 bytes of boot stack.
~~~~~
00000200 a stack_size
...
0000fe00 B _stack
00010000 B _estack
~~~~~
This stack space becomes vacant as soon as the scheduler is started by calling vTaskStartScheduler()
.
The function xTaskCreate()
will have allocated stack space for each of the tasks ( using pvPortMalloc()
).
Regards.
I could not find anything in the map file.
but the structure pxNewTCB->pxStack was a good hint!
Thanks to all
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.