dsp flash 程序搬运到ram

it2022-05-05  210

SECTIONS { /* Allocate program areas: */ .cinit : > FLASHB PAGE = 0 .pinit : > FLASHB, PAGE = 0 .text : > FLASHB PAGE = 0 codestart : > BEGIN PAGE = 0 ramfuncs :>LOAD =FLASHD, /****定义一个段在flashd中**/ RUN=RAML0, /****复制到哪里运行****/ LOAD_START(_RamfuncsLoadStart),/**获取段对应的起始地址*/ LOAD_END(_RamfuncsloadEnd), /***获取段对应的结尾地址******/ RUN_START(_RamfuncsRunStart);/**获取Run的起始地址***/ /********************** LOAD_START LOAD_END RUN_START 是能够生成全局符合的指令。 生成的全局符号 决定了装载地址 运行地址和 段长度 LOAD_START(_RamfuncsLoadStart),/**_RamfuncsLoadStart 指向到load 起始地点*/ LOAD_END(_RamfuncsloadEnd), /** _RamfuncsLoadEnd 指向到load 结尾地点******/ RUN_START(_RamfuncsRunStart ) /***_RamfuncsRunStart 指向到Run的起始********/ */ 。。。。。。。。。。。。。。。

LOAD_SRART LOAD_END 都是让变量指向LOAD  开头和结尾  此处我FLASHD

RUN_START 则是指向RUN 对应的起始地址 此处为RAML0

对应的地址声明

extern Uint16 RamfuncsLoadStart;

extern Uint16 RamfuncsLoadEnd;

extern Uint16 RamfuncsRunStart;

 

使用命令 #pragma CODE_SECTION(函数命,"ramfuncs");

可以把要在ram 运行的函数按排到ramfuncs 段。

在运行函数前  通过下面语句搬运到ram  实现期望的函数在ram运行

MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart); // ramfuncs


最新回复(0)