Quality RTOS & Embedded Software

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



Posted by Oren La on March 17, 2008

I read the the documents about FreeRTOS and i have a some questions
concerning the stack.

I saw that when i call to : xTaskCreate(...) i have to give it a
stack depth parameter.
- What will be saved in this stack?
- Is it true that this stack is create by memory allocation?
- In a context switch the regs,flags,... will be saved to the stack,
how this RTOS handle and position this data to every task?


RE: Stack

Posted by Dave on March 17, 2008
The stack used by the task is just like any stack used in a C program. There is nothing special or different about it.

RE: Stack

Posted by Oren La on March 17, 2008
So why do i need the stack depth parameter?

RE: Stack

Posted by JMR on March 18, 2008
You need to specify the stack size for each task so that the OS can reserve this amount from the available heap memory.
The compiler only knows about stack pointer it doesn't do any per task stack allocation. This is done by the RTOS, which doesn't know how much memory a particular task will require during runtime...

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

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

Latest News

FreeRTOS v10.2.0 is available for immediate download. MIT licensed, and including RISC-V and ARMv8-M (Cortex-M33) demos.

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

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


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

Espressif ESP32

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

Xilinx Microblaze and Zynq partner