FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [February 2006 Threads] configMINIMAL_STACK_SIZEPosted 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_SIZEPosted 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.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|