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

configMINIMAL_STACK_SIZE

Posted by Nobody/Anonymous on February 8, 2006
Can you point me at some more information about the configMINIMAL_STACK_SIZE parameter? I am using the Philips LPC2103 with 8K of internal SRAM and for obvious reasons would like to minimize the amount used by the OS.

RE: configMINIMAL_STACK_SIZE

Posted by Richard on February 8, 2006
As with any program or function the amount of stack necessary is dependent on the number of local (stack)variables, the function call nesting depth, how library functions are used (like printf which is very stack hungry) and how interrupts use the stack. You can write your software to minimise stack usage if this is your priority.

The only place configMINIMAL_STACK_SIZE is actually used within the scheduler source code itself is to size the stack used by the idle task. However, in the demo projects it is also used to size the stack for the majority of the demo application tasks (in the demo/common directory). A consequence of this is that the demo application projects tend to set configMINIMAL_STACK_SIZE to a value greater than the scheduler itself actually needs.

You can define your application stack sizes to be whatever you want and tailor the size to each task. This would allow you to set the minimal stack definition to be smaller as it would only then be used by the idle task.

You can use the usTaskCheckFreeStackSpace() function (not in release code!) to see if you have enough wiggle room for your settings. Alternatively you can simple run the code in a debugger and check the stacks high water mask.

Remember that the stack has to be large enough for the context to be saved onto the stack by the scheduler.

FreeRTOS 4 should be available by the beginning of April. This has a new feature for stack limited systems.

Regards.


[ 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