I’d also like to know how to secure a stack area of a particular size as a user.
If you have designated the -device option for the linker, find a continuous area of RAM which is not in use, then create the following symbols.
・__STACK_ADDR_START： Highest address of the area + 1
・__STACK_ADDR_END： Lowest address of the area
__STACK_ADDR_START will be the initial value of the stack pointer (SP).
To secure a stack area of a particular size, define the section for the stack in the startup routine, define the symbol for its highest address +1, and set the address of the symbol in the stack pointer (SP).
Example: Definition of a section for the stack (securing 0x200 bytes)
.SECTION .stack_bss, BSS
Example: Configuring the stack pointer (SP)
|CS+ (formerly CubeSuite+)|
|C Compiler Package for RL78 Family|