yb元素 粉末冶金:分散加载描述文件(转载)

来源:百度文库 编辑:中财网 时间:2024/04/29 23:51:11

        分散加载描述文件供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~0x81080000

ROM_LOAD 0x0    ;ROM_LOAD:>                ;0x0:Start address for ROM_LOAD region.
{
    ROM_EXEC 0x00000000    ;ROM_EXEC:>                           ;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