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 };

你可能感兴趣的:(IAR环境下使用rt-thread的finsh,所有命令返回Null node处理)