I'd like to store a variable/array at a fixed memory address within the firmware image.
The idea is to create an firmware image with the variable/array at a fixed location so that I can manipulate these variables/array without having to recompile.
With GCC I'd do this by creating a new section within the linker file:
Code: Select all
MEMORY
{
m_interrupts (rx) : ORIGIN = 0x00000000, LENGTH = 0xC0
m_cfmprotrom (rx) : ORIGIN = 0x00000400, LENGTH = 0x10
m_text (rx) : ORIGIN = 0x00000800, LENGTH = 128K - 0x800
m_data (rwx) : ORIGIN = 0x1FFFF000, LENGTH = 16K
}
Code: Select all
SECTIONS
{
/* placing my named section at given address: */
.myBufBlock 0x20000000 :
{
KEEP(*(.myBufSection)) /* keep my variable even if not referenced */
} > m_data
/* other placements follow here... */
}
Code: Select all
unsigned char __attribute__((section (".myBufSection"))) buf[128];
How do I do this when using the XTC toolchain?
Thanks
Alex