Quality RTOS & Embedded Software

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


Loading

Stack

Posted by Oren La on March 17, 2008
Hello

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?

Thanks

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

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

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

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


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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