|ARM Technical Support Knowledge Articles|
Applies to: C166 C Compiler
Information in this article applies to:
How do I change the size and location of the system stack?
Configure the startup code START167.A66 (not required for XC16x devices) for no wrapping stack and define the location of the stack section using the L166 SECTIONS directive.
; STKSZ: Maximum System Stack Size selection (SYSCON.13 .. SYSCON.15) ; Defines the system stack space which is used by CALL/RET and PUSH/POP ; instructions. The system stack space must be adjusted according the ; actual requirements of the application. $SET (STK_SIZE = 7) ; System stack sizes: ; 0 = 256 words (Reset Value) ; 1 = 128 words ; 2 = 64 words ; 3 = 32 words ; 4 = 512 words ; 5 = not implemented ; 6 = not implemented ; 7 = no wrapping (entire internal RAM use as STACK, set size with SYSSZ) ; If you have selected 7 for STK_SIZE, you can set the actual system stack size ; with the following SSTSZ statement. SSTSZ EQU 200H ; set System Stack Size to 200H Bytes
?C_SYSSTACK%IDATA (0xFA00)As alternative you may use the Linker SECTIONS directive at the command line. Note that the stack must be within IDATA RAM.
Article last edited on: 2005-06-02 06:59:49
Did you find this article helpful? Yes No
How can we improve this article?