打印
[ZLG-ARM]

一个SCF文件讲解

[复制链接]
1198|2
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
reeper|  楼主 | 2009-4-9 15:02 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
散加载描述文件供ARM-ADS链接器使用,用来决定各个代码段和数据段的存储位置,下面为一个添加注释后的.scf文件例子:


代码:
;YL-LPC2294片内FLASH分散加载文件;Internal Flash 256kBytes,                Address range:0x00000000~0x0003ffff;Internal SRAM 16KBytes,                Address range:0x40000000~0x40003fff;External Flash 2MBytes,SST39VF1601,   Address range:0x80000000~0x401fffff;External SRAM 512KBytes,IS61LV25616,Address range:0x81000000~0x81080000ROM_LOAD 0x0    ;ROM_LOAD:Name of the load region.                ;0x0:Start address for ROM_LOAD region.{    ROM_EXEC 0x00000000    ;ROM_EXEC:Name for the first execute region.                           ;0x00000000:Start address for the execture region.    {        Startup.o (vectors, +First)            * (+RO)            ; Place all code and RO data into this exec region,                           ;and make sure the 'vectors' section from 'Startup.o'                           ;be placed first.    }    IRAM 0x40000000        ;The second execute region;start address is 0x40000000.    {        Startup.o (+RW,+ZI) ; Place all RW and ZI data from Startup.o here.    }    ERAM 0x81068000         ;The third execute region;Start address:0x81068000.    {        * (+RW,+ZI)         ;All reset RW/ZI data to be placed here.    }    HEAP +0 UNINIT          ;The fourth execute region;Start address:Follow the                            ;end of ERAM region.    {        heap.o (+ZI)        ;All ZI data from heap.o to be placed here.    }    STACKS 0x40004000 UNINIT ;The fifth execute region.    {        stack.o (+ZI)        ;All ZI data from stack.o to be placed here.    }}


一般一个简单的分散加载描述文件包含三部分:Loader region、Execute region、Input section。各部分的格式及定义细节参见文件:ADS_LinkerGuide.pdf

相关帖子

沙发
zcying| | 2009-4-9 15:05 | 只看该作者

我觉得加载这一部分对初学者来说是比较抽象的。

使用特权

评论回复
板凳
zcying| | 2009-4-9 15:06 | 只看该作者

我在开始弄的时候就犯了很多错误

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

139

主题

185

帖子

0

粉丝