Greetings,
I am trying to reserve a chunk of RAM to be used for information transfer from boot code and main application. I am writing the boot code now and trying to reserve the memory at 0x20000000 (len=0x400).
The following is my link command file:
--retain=g_pfnVectors
--retain=PrebootVector
--retain=Header
--retain=ExHeader
MEMORY
{
FLASH (RX) : origin = 0x00000000, length = 0x00008000 LAST(__IMG_SIZE)
SRAM (RWX) : origin = 0x20000400, length = 0x00040000 - 1K
}
/* The following command line options are set as part of the CCS project. */
/* If you are building using the command line, or for some reason want to */
/* define them here, you can uncomment and modify these lines as needed. */
/* If you are using CCS for building, it is probably better to make any such */
/* modifications in your CCS project and leave this file alone. */
/* */
/* --heap_size=0 */
/* --stack_size=256 */
/* --library=rtsv7M4_T_le_eabi.lib */
/* Section allocation in memory */
SECTIONS
{
.pbootvec: > 0x00000000
.header: > 0x00000120
.intvecs: > 0x00000200
.text : > FLASH
.const : > FLASH
.cinit : > FLASH
.pinit : > FLASH
.init_array : > FLASH
.vtable : > 0x20000400
.data : > SRAM
.bss : > SRAM
.sysmem : > SRAM
.stack : > SRAM
}
__STACK_TOP = __stack + 512;
Note that the SRAM range starts from 0x20000400.I am expecting that the this location (0x20000000 -0x200003ff) will not be touched. To verify this, I did a experiment to assign some value to this location. I start a debug session and make sure the values are assigned, and then I stop the debug session, without power reset the board, I start the debug session again. In theory, since the MCU has not been power reset, the assigned value should still be there. However, this is not the case. It seems that this location is always initialized to certain value even if it is not in the defined SRAM range. Since nowhere else in the project is doing this, I suspect that it is the code in _c_int00() who did the trick.
I also did similar experiment on a different IDE (Semens' CodeBench) and the result was expected.
Is there a solution for this ?