配置好主程序的CMD文件,才能將FLASH成功燒錄章母,并且將FLASH中的文件拷貝到RAM中運(yùn)行沟娱。關(guān)于CMD文件的配置:
首先在F2812.CMD文件中铭污,可以看到有關(guān)于加載FLASH到RAM的內(nèi)容:
ramfuncs : LOAD = FLASHD,
RUN = RAML0,
LOAD_START(_RamfuncsLoadStart),
LOAD_END(_RamfuncsLoadEnd),
RUN_START(_RamfuncsRunStart),
PAGE = 0
以及在C文件中調(diào)用FLASH 到RAM的函數(shù)memcpy嗡官,將它放在系統(tǒng)初始化(InitSystem();)之后運(yùn)行箭窜。
InitSystem();
memcpy(&RamfuncsRunStart,
&RamfuncsLoadStart,
&RamfuncsLoadEnd - &RamfuncsLoadStart);
Initflash();
關(guān)于ramfuncs,則在系統(tǒng)初始化中定義即可衍腥。如:sysctrl.c中