Quality RTOS & Embedded Software

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




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) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists