How to Modify the Address of Stack
Hi,
My application has a bootloader, recently, I allocated a large block of memory on top of SRAM to protect the data from system resets, this causes the highest address of user stack changes, when this highest addresses of user stack are different in Bootloader and App, the app does not work.
I assume that if I could modify the highest address of the user stack in the main() of App, it may make it work, but I don't know how to do this.
The highest address of the user stack of bootloader and App defined in .ld files are as below:
Bootloader:
_estack = ORIGIN(RAM) + LENGTH(RAM) - 256; /* end of "RAM" Ram type memory */
App:
_estack = ORIGIN(RAM) + LENGTH(RAM) - 14592; /* end of "RAM" Ram type memory */
The memory definitions for the both are:
bootloader:
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 48K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 256K
}
App:
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 48K
FLASH (rx) : ORIGIN = 0x08014000, LENGTH = 176K
}
Regards
Chao
