Quality RTOS & Embedded Software

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


Loading

Stack usage in a task

Posted by Willem on November 9, 2008
What is the best way to determine how many stack I need to assign to a task?

RE: Stack usage in a task

Posted by MEdwards on November 9, 2008
Well you could try calculating it [max function call depth + plus max interrupt nesting depth + etc] but really trial and error is the best way. Start at [configMINIMAL_STACK_SIZE * 2], let the task run for a bit, then inspect the high water mark using http://www.freertos.org/uxTaskGetStackHighWaterMark.html and adjust as fit.

If the task does not get that far use http://www.freertos.org/Stacks-and-stack-overflow-checking.html to trap errors.

The new MPLAB and Eclipse plugins make this easier as they display the high water mark.

RE: Stack usage in a task

Posted by Willem on November 9, 2008
Ah, didn't know that kind of (powerfull) tools.

How about the plugin? I have the latest version (not beta) of MPlab.

RE: Stack usage in a task

Posted by Willem on November 9, 2008
*just curious, how big is the minimal_stack_size ? I mean, how many stacks can it contain?

RE: Stack usage in a task

Posted by MEdwards on November 9, 2008
It is sized so the idle task can run without crashing, but how big that has to be depends on the architecture. The idle task does not do anything so only requires a small stack.


[ 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