搜索
bottom↓
回复: 1

关于IAR for ARM的.icf文件

[复制链接]

出0入0汤圆

发表于 2014-5-28 11:13:41 | 显示全部楼层 |阅读模式
        用IAR EWARM开发S3C2440A裸机程序,程序下载到Nand Flash,想实现程序先在内部4KB RAM中运行初始化代码,将Nand Flash中的程序拷贝到外部SDRAM后,代码开始跳转到SDRAM中执行。
        据我研究,需要配置连接器配置文件(.icf),但是一直没有成功,请教大伙帮帮忙呀!如下是我的.icf文件:
/*###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__ = 0x0000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x0000;
define symbol __ICFEDIT_region_ROM_end__   = 0x0FFFFFFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x30000000;
define symbol __ICFEDIT_region_RAM_end__   = 0x33FFFFFF;
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__   = 0x2000;
define symbol __ICFEDIT_size_svcstack__ = 0x100;
define symbol __ICFEDIT_size_irqstack__ = 0x100;
define symbol __ICFEDIT_size_fiqstack__ = 0x100;
define symbol __ICFEDIT_size_undstack__ = 0x100;
define symbol __ICFEDIT_size_abtstack__ = 0x100;
define symbol __ICFEDIT_size_heap__     = 0x8000;
/**** End of ICF editor section. ###ICF###*/


/* Internal RAM symbol define ------------------------------------------------*/
/* Internal RAM symbol define ------------------------------------------------*/
/*-Specials-*/
define symbol __IRAM_intvec_start__ = 0x0000;
/*-Memory Regions-*/
define symbol __IRAM_region_ROM_start__ = 0x0000;
define symbol __IRAM_region_ROM_end__   = 0x02000000;
define symbol __IRAM_region_RAM_start__ = 0x0000;
define symbol __IRAM_region_RAM_end__   = 0x1000;
/*-Sizes-*/
define symbol __IRAM_size_cstack__   = 0x10;
define symbol __IRAM_size_svcstack__ = 0x8;
define symbol __IRAM_size_irqstack__ = 0x8;
define symbol __IRAM_size_fiqstack__ = 0x8;
define symbol __IRAM_size_undstack__ = 0x8;
define symbol __IRAM_size_abtstack__ = 0x8;
define symbol __IRAM_size_heap__     = 0x40;
/* Internal RAM symbol define --------------------END-------------------------*/
/* Internal RAM symbol define --------------------END-------------------------*/


define memory mem with size = 4G;

define region ROM_region   = mem:[from __ICFEDIT_region_ROM_start__   to __ICFEDIT_region_ROM_end__];
define region RAM_region   = mem:[from __ICFEDIT_region_RAM_start__   to __ICFEDIT_region_RAM_end__];

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

define region IRAM_RAM_region   = mem:[from __IRAM_region_RAM_start__   to __IRAM_region_RAM_end__];

define block IRAM_CSTACK    with alignment = 8, size = __IRAM_size_cstack__   { };
define block IRAM_SVC_STACK with alignment = 8, size = __IRAM_size_svcstack__ { };
define block IRAM_IRQ_STACK with alignment = 8, size = __IRAM_size_irqstack__ { };
define block IRAM_FIQ_STACK with alignment = 8, size = __IRAM_size_fiqstack__ { };
define block IRAM_UND_STACK with alignment = 8, size = __IRAM_size_undstack__ { };
define block IRAM_ABT_STACK with alignment = 8, size = __IRAM_size_abtstack__ { };
define block IRAM_HEAP      with alignment = 8, size = __IRAM_size_heap__     { };


initialize by copy { readwrite };
//initialize by copy with packing = none { section __DLIB_PERTHREAD }; // Required in a multi-threaded application
do not initialize  { section .noinit };

place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };

place at start of ROM_region { readonly section .cstart }; // Place Startup Code at start of ROM
place in          ROM_region { readonly };                 // Place Other Code in ROM

place in IRAM_RAM_region     { readwrite section .cstart,  // Place Startup readwrite section in Internal RAM
                               block IRAM_CSTACK, block IRAM_SVC_STACK, block IRAM_IRQ_STACK, block IRAM_FIQ_STACK,
                               block IRAM_UND_STACK, block IRAM_ABT_STACK, block IRAM_HEAP };
place in      RAM_region     { readwrite,                  // Place Other readwrite section in External SDRAM
                               block CSTACK, block SVC_STACK, block IRQ_STACK, block FIQ_STACK,
                               block UND_STACK, block ABT_STACK, block HEAP };

阿莫论坛20周年了!感谢大家的支持与爱护!!

知道什么是神吗?其实神本来也是人,只不过神做了人做不到的事情 所以才成了神。 (头文字D, 杜汶泽)

出0入0汤圆

 楼主| 发表于 2014-5-28 11:19:25 | 显示全部楼层
补充:我通过位于NOR Flash中的U-Boot启动,把代码下载到Nand Flash,2440没能达到预期的效果(LED亮);通过J-Link调试发现PC一直没能跳转到SDRAM(0x30000000)中,虽然能够达到预期效果(LED亮)。
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片。注意:要连续压缩2次才能满足要求!!】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-7-23 09:09

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表