IAR环境下使用rt-thread的finsh,所有命令返回Null node处理

IAR环境下使用rt-thread的finsh,所有命令返回Null node处理

rt-thread 3.0.2中移植到LPC1778过程中,发现该问题,由于rt-thread 3.0.2这个版本没有LPC1778芯片例程,所以自己就从keil下移植到IAR下,移植后能正常运行,但使用finsh时,效果却不同。
经过多方查找原因,发现IAR下使用finsh,需要使用到icf连接文件,添加默认的ICF文件后,需要在ICF文件下添加如下两句内容:

keep { section FSymTab };
keep { section VSymTab };

至于添加的位置,可以参考其他芯片(如LPC176x)下,rt-thread例程的ICF文件里面的位置。

LPC1778添加后文件内容如下:

/###ICF### Section handled by ICF editor, don’t touch! ***/
/-Editor annotation file-/
/* IcfEditorFile=” TOOLKIT D IR  T O O L K I T D I R \config\ide\IcfEditor\cortex_v1_0.xml” */
/-Specials-/
define symbol ICFEDIT_intvec_start = 0x00000000;
/-Memory Regions-/
define symbol ICFEDIT_region_ROM_start = 0x00000000;
define symbol ICFEDIT_region_ROM_end = 0x0007FFFF;
define symbol ICFEDIT_region_RAM_start = 0x10000000;
define symbol ICFEDIT_region_RAM_end = 0x1000FFDF;
/-Sizes-/
define symbol ICFEDIT_size_cstack = 0x800;
define symbol ICFEDIT_size_heap = 0x1000;
/** End of ICF editor section. ###ICF###*/

define symbol CRP_start = 0x000002FC;
define symbol CRP_end = 0x000002FF;

define symbol RAM1_start = 0x20000000;
define symbol RAM1_end = 0x20007FFF;

define memory mem with size = 4G;
define region ROM_region = mem:[from ICFEDIT_region_ROM_start to ICFEDIT_region_ROM_end] - mem:[from CRP_start to CRP_end];
define region RAM_region = mem:[from ICFEDIT_region_RAM_start to ICFEDIT_region_RAM_end];
define region CRP_region = mem:[from CRP_start to CRP_end];
define region RAM1_region = mem:[from RAM1_start to RAM1_end];

define block CSTACK with alignment = 8, size = ICFEDIT_size_cstack { };
define block HEAP with alignment = 8, size = ICFEDIT_size_heap { };

initialize by copy { readwrite };
do not initialize { section .noinit };

keep { section FSymTab };
keep { section VSymTab };

place at address mem:ICFEDIT_intvec_start { readonly section .intvec };
place in ROM_region { readonly };
place in RAM_region { readwrite,
block CSTACK, block HEAP };
place in CRP_region { section .crp };
place in RAM1_region { section .sram };

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值