Linker Script Issue When Porting To CC2538


Tidy(ChunHua) Jiang <tidyjiang@...>
 

Hello,

I'm porting zephyr to TI's CC2538 device family, but there is a special user case —— customer
configuration area(CCA/CCFG). CCA is placed in the uppermost flash page, so the linker script
would like this:

MEMORY
{
FLASH (rx) : ORIGIN = 0x00200000, LENGTH = 0x0007FFD4
FLASH_CCA (rx) : ORIGIN = 0x0027FFD4, LENGTH = 0x2C
SRAM (wx) : ORIGIN = RAM_ADDR, LENGTH = RAM_SIZE
SYSTEM_CONTROL_SPACE (wx) : ORIGIN = 0xE000E000, LENGTH = 4K
SYSTEM_CONTROL_PERIPH (wx) : ORIGIN = 0x400FE000, LENGTH = 4K
}

ENTRY(flash_cca_lock_page)

...
GROUP_START(FLASH_CCA)
SECTION_PROLOGUE(.flash_cca,,)
{
KEEP(*(.flash_cca))

} GROUP_LINK_IN(FLASH_CCA)
GROUP_END(FLASH_CCA)
...

Please ignore the numerical hard-code.
How can I compatibly place this code to the original link script?
Does this ok:?

SECTIONS
{
GROUP_START(ROMABLE_REGION)
...
#ifdef CONFIG_CC2538_CCA_XXXXX
SECTION_PROLOGUE(.flash_cca,,)
{
. = 0x0027FFD4
KEEP(*(.flash_cca))
} GROUP_LINK_IN(ROMABLE_REGION)
#endif // CONFIG_CC2538_CCA_XXXXX
GROUP_END(ROMABLE_REGION)
...
}
Please ignore the numerical hard-code too.
Best Regards,
tidyjiang.

Join devel@lists.zephyrproject.org to automatically receive all group messages.