I want to locate stack pointer, stack start and end address in linker file.
And change it for my customize address, pointing the stack pointer to the base address of the stack in SRAM.
MCU - RA2L1 Series
1. to trace down the stack address.
2. How to customize the stack address.
Thanks in Advance.
Thanks for reaching out to Renesas Engineering Community.
The stack pointer is stored in 'SP' register. You can see its value from the 'Registers' tab under the General Registers.
To find the start and end address of the stack open the .map file in the Debug folder of your project and search for .stack.
In the below project the size of the stack is 0x500 as specified on the BSP tab and the memory range is 0x20000148 - 0x20000648.
Why do you want to customize the stack address ?
Thank you for your reply.
Below Screen shot,
My map file is different from yours. .bss start immediately after the .stack. the difference between 2 is 0x400 i.e 1Kb.
How can I define this .stack in linker to to map in other location and differnt size in SRAM.
You can do this by modifying the linker script (fsp.ld file under script folder).
For example to change the stack start address to 0x20000278: