How does one go about specifying a specific address for a variable (in my case pointer table)?
I can get the pointer table to be placed at the specific RAM address, but it is not initialized with the correct data (or any data?).
I start by adding a section in MEMORY
MEMORY
{
FLASH_1 (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000400
FLASH_CONFIG (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010
FLASH_2 (RX) : ORIGIN = 0x00000410, LENGTH = 0x0001BBF0
CAL_FLASH (RX) : ORIGIN = 0x0001C000, LENGTH = 0x00020000
PTR_TABLE (RW) : ORIGIN = 0x1FFFF000, LENGTH = 0x00000200
SRAM (RW) : ORIGIN = 0x1FFFF200, LENGTH = 0x00003E00
}
Then, I reserve the memory:
.ptrTable : AT(__DATA_ROM)
{
. = ALIGN(4);
_ptrTableSection = .; /* create a global symbol at PtrTable */
*(.ptrTable)
. = ALIGN(4);
} > PTR_TABLE
Finally, the romp:
.romp : AT(_romp_at)
{
__S_romp = _romp_at;
LONG(__DATA_ROM);
LONG(_ptrTableSection);
LONG(SIZEOF(.ptrTable));
LONG(__DATA_ROM + SIZEOF(.ptrTable));
LONG(_sdata);
LONG(___data_size);
LONG(0);
LONG(0);
LONG(0);
} > SRAM
For now, my work around is to define the pointer table as ROM data then copy this over at runtime manually to the RAM pointer table. There must be a better way of doing this. What am I doing wrong here?
Thanks,
Robert