RTEMS Logo

RTEMS 4.6.99.3 On-Line Library


Task Context Management Minimum Task Stack Size

PREV UP NEXT Bookshelf RTEMS Porting Guide

6.2.2: Minimum Task Stack Size

The CPU_STACK_MINIMUM_SIZE macro should be set to the minimum size of each task stack. This size is specified as the number of bytes. This minimum stack size should be large enough to run all RTEMS tests. The minimum stack size is chosen such that a "reasonable" small application should not have any problems. Choosing a minimum stack size that is too small will result in the RTEMS tests "blowing" their stack and not executing properly.

There are many reasons a task could require a stack size larger than the minimum. For example, a task could have a very deep call path or declare large data structures on the stack. Tasks which utilize C++ exceptions tend to require larger stacks as do Ada tasks.

The following illustrates setting the minimum stack size to 4 kilobytes per task.

#define CPU_STACK_MINIMUM_SIZE          (1024*4)


PREV UP NEXT Bookshelf RTEMS Porting Guide

Copyright © 1988-2004 OAR Corporation