SPRU513Z August 2001 – October 2023 SM320F28335-EP
The TMS320C28x C/C++ compiler uses an uninitialized section, .stack, to allocate space for the run-time stack. You can set the size of this section in words at link time with the --stack_size option. The syntax for the --stack_size option is:
--stack_size= size
The size must be a constant and is in words. This example defines a 4K word stack:
cl2000 --run_linker --stack_size=0x1000 /* defines a 4K heap (.stack section)*/
If you specified a different stack size in an input section, the input section stack size is ignored. Any symbols defined in the input section remain valid; only the stack size is different.
When the linker defines the .stack section, it also defines a global symbol, __STACK_SIZE (for COFF) or __TI_STACK_SIZE (for EABI) , and assigns it a value equal to the size of the section. The default software stack size is 1K words. See Section 8.6 for information about referring to linker symbols in C/C++ code.