Quality RTOS & Embedded Software

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




Loading

stack location in RAM

Posted by antoxaxa on December 7, 2015

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,


stack location in RAM

Posted by rtel on December 7, 2015

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.


stack location in RAM

Posted by tlafleur on December 7, 2015

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

Attachments

alternate (1360 bytes)

stack location in RAM

Posted by heinbali01 on December 8, 2015

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.


stack location in RAM

Posted by antoxaxa on December 8, 2015

I could not find anything in the map file. but the structure pxNewTCB->pxStack was a good hint!

Thanks to all


[ 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