h85968099 发表于 2010-10-16 11:32:09

请问怎样把IAR生成的bin文件下载到板的nandflash里面然后运行呢?

我的板子是ARM9的板子,uboot 引导linux启动的
现在我需要跑裸机程序,由于板子没有norflash,所以不能用jlink直接下载,裸机程序我是用jlink在ram里面调试好了的都好用
我想是用IAR生成bin文件,然后用UBOOT下载到ram里面然后运行,现在是我生成的文件下载到地址0x40000000之后,go 0x40000000,板子没有反应,不知道有没有做过类似方案的前辈?

h85968099 发表于 2010-10-16 11:34:27

IAR有两总编译方式,一种是NOR debug 一种是sdram debug,两种不同的ICF,我用哪一个呢?

llf021421 发表于 2010-10-16 12:07:49

由于你的板子没有norflash,所以不能用NOR debug,而你又想下载到nandflash中运行,sdram debug也不行,需要自己写一个配置文件。还有要注意异常向量表的问题,发生中断的时候程序会跳到0x0去

h85968099 发表于 2010-10-16 12:47:42

回复【2楼】llf021421马中马
-----------------------------------------------------------------------

哦,这样啊,我也是用U BOOT下载到SDRAM里面运行的,这样能用sdram debug的配置吗?

h85968099 发表于 2010-10-16 13:08:26

/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_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__   = 0x00000000;
define symbol __ICFEDIT_region_RAM_start__   = 0x40000000;
define symbol __ICFEDIT_region_RAM_end__   = 0x43FFFFFF;
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__   = 0x1000;
define symbol __ICFEDIT_size_svcstack__ = 0x40;
define symbol __ICFEDIT_size_irqstack__ = 0x200;
define symbol __ICFEDIT_size_fiqstack__ = 0x0;
define symbol __ICFEDIT_size_undstack__ = 0x0;
define symbol __ICFEDIT_size_abtstack__ = 0x0;
define symbol __ICFEDIT_size_heap__   = 0x2000;
/**** End of ICF editor section. ###ICF###*/

define memory mem with size = 4G;

define symbol __region_iRAM_start__   = 0xF8002080;
define symbol __region_iRAM_end__   = 0xF800FFFF;


define region ROM_region   = mem:;
define region RAM_region   = mem:;
define region iRAM_region= mem:;


define block CSTACK    with alignment = 8, size = __ICFEDIT_size_cstack__   { };
define block SVC_STACK with alignment = 8, size = __ICFEDIT_size_svcstack__ { };
define block IRQ_STACK with alignment = 8, size = __ICFEDIT_size_irqstack__ { };
define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { };
define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { };
define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { };
define block HEAP      with alignment = 8, size = __ICFEDIT_size_heap__   { };

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

// this section is plased into the Built-in RAM3, that is maped on address 0
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };

place in RAM_region   { readonly};

place in RAM_region   { readwrite, block HEAP, block MMUTT {section MMU_TT}};

// this section is plased into the Built-in RAM area
place in iRAM_region   { block CSTACK, block SVC_STACK, block IRQ_STACK,
                         block FIQ_STACK, block UND_STACK, block ABT_STACK, };
这是sdram的ICF,不知道为什么生成的.BIN文件好大,好几百MB

h85968099 发表于 2010-10-16 14:10:56

好了,弄出来了
define symbol __ICFEDIT_intvec_start__ = 0x40000000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__   = 0x00000000;
define symbol __ICFEDIT_region_ROM_end__   = 0x00000000;
define symbol __ICFEDIT_region_RAM_start__   = 0x40000080;
define symbol __ICFEDIT_region_RAM_end__   = 0x43FFFFFF;
ICF改了上面这些东西,然后TFTP 0X40000000,然后GO 0X40000000,裸机程序就跑起来了,
PS:感谢2楼,
页: [1]
查看完整版本: 请问怎样把IAR生成的bin文件下载到板的nandflash里面然后运行呢?