Taksing 将代码编译到RAM
1. 在链接文件中增加Ram段
group FlashDriverRAM (ordered,contiguous,run_addr = 0x7001AC00)
{
section "BswFlashDriverRAM" (size =2k,attributes = rwx, fill = 0xFF)
{
select ".text.BswFlashDriverRAM";
}
}
2. 在函数定义前增加编译指令
#define FLASH_DRIVER_LOCATED_IN_RAM (TRUE)
#if FLASH_DRIVER_LOCATED_IN_RAM
#pragma section code "BswFlashDriverRAM"
#pragma align 4
#endif
void f()
{
/* 函数实体 */
}
#if FLASH_DRIVER_LOCATED_IN_RAM
#pragma section code restore
#endif
3. 编译结果
可以通过map.或者sre文件确认,相关函数是否已编译到指定地址