有2段程序:分别是hello_world_main 和hello_world_main_test,这2段程序放在不同的Section
void __attribute__ ((section("TC"))) hello_world_main(void *args)
{
/* Open drivers to open the UART driver for console */
Drivers_open();
Board_driversOpen();
DebugP_log("Hello World!\r\n");
DebugP_log("This is new HW!\r\n");
Board_driversClose();
Drivers_close();
}
void __attribute__ ((section("TC1"))) hello_world_main_test(void *args)
{
/* Open drivers to open the UART driver for console */
Drivers_open();
Board_driversOpen();
DebugP_log("Hello World Test!\r\n");
DebugP_log("This is new HW!\r\n");
Board_driversClose();
Drivers_close();
}
以下是Linker.cmd文件中关于TC和TC1的说明。
SECTIONS
{
/* This has the M4F entry point and vector table, this MUST be at 0x0 */
.vectors:{} palign(8) > M4F_VECS
.bss: {} palign(8) > M4F_RAM12 /* This is where uninitialized globals go */
RUN_START(__BSS_START)
RUN_END(__BSS_END)
.text: {} align(8) >> M4F_RAM12 | M4F_RAM3 /* This is where code resides */
.data: {} align(8) >> M4F_RAM12 | M4F_RAM3 /* This is where initialized globals and static go */
.rodata: {} align(8) >> M4F_RAM12 | M4F_RAM3 /* This is where const's go */
.sysmem: {} palign(8) > M4F_RBL /* This is where the malloc heap goes */
.stack: {} palign(8) > M4F_RBL /* This is where the main() stack goes */
.l3: {} palign(8) > HWASS_SHM_MEM /* This is where L3 data goes */
TC: {} align(8) LOAD = 0x00440000, RUN = 0x00420000
TC1: {} align(8) LOAD = 0x00441000, RUN = 0x00420000
}
MEMORY
{
M4F_VECS : ORIGIN = 0x00400000 , LENGTH = 0x00000200
M4F_RAM12 : ORIGIN = 0x00400200 , LENGTH = (0x00058000 - 0x200) /* 32KB of RAM2 is being used by RBL */
M4F_RBL : ORIGIN = 0x00458000 , LENGTH = 0x8000 /* 32KB of RAM2 is being used by RBL */
M4F_RAM3 : ORIGIN = 0x00460000 , LENGTH = 0x00020000
HWASS_SHM_MEM : ORIGIN = 0x60000000, LENGTH = 0x00068000 /* 256KB in APPSS PD and 160KB in HWA PD */
}
在编译时提示错误:
请问这个要如何解决不同程序在不同时刻在同一块RAM上运行?