欢迎来到天天文库
浏览记录
ID:35530844
大小:84.44 KB
页数:6页
时间:2019-03-25
《dsp2812flash运行程序加速的方法》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、日期:2009.3.11上午9:49刚刚把2812内部flash运行程序加速调试通了,结果比较成功。为了以后少走弯路,把刚才的调试过程记录一下。参考的资料是TI的RunninganApplicationfromInternalFlashMemoryontheTMS320F28xxxDSP,文档编号是SPRA958H。由于我是采用的自己编写CMD的方式,所以工程属于Non-DSP/BIOSProjectso内部flash运行加速需要添加的文件有CodeStartBranch.asm,Passwords.asm,DSP281x_MemCopy.c,另外还需要有voidInitFlash(void
2、)函数完成对FLASH的初始化配置。1.InitializingtheFlashControlRegisters(DSP/BIOSandnon-DSP/BIOSprojects)^pragmaCODE_SECTIOK(InitFlash,'fsecureRairrjncsn)voidInitFlash(void)asm(nEALLOW11);FlashRegs.FPWR.bit.PWR二3;FlashRegs.FSTATJS.bit.V3STAT=1;//EnableEALLOWprotectedregisteraccess//Flashsettoactivenode//Clearthe3V
3、STATbit//SleeptostandbycyclesFlashRegs.FSTEBYWAIT.bit.STDBYV?AIT二OxOlFF;FlashRegs.FACTIVE祛I?.bit.UnVEWAITOxOlFF;//StandbytoactivecyclesFlashRegs.FBANKWAIT.bit.RANDWAIT二3;FlashRegs.FBAKKWAIT.bit.PAGEWA:T=3;FlashRegs.FOTPWAIT.b辻.OTPWAIT=5;FlashRegs.FOPT.bit.ENPIPE=1;//F280xRandomaccesswaitstates//F28
4、0xPagedaccesswaitstates//F280xOTPwaitstates//Enabletheflashpipeline//DisableEALLOWprotectedregisteraccess***Forceacompletepipelineflushtoensurethatthewritetoth?lastregisterconfiguredoccursbeforereturning.Safestthingistowait8fullcycles.***asm(nRPT#6
5、
6、NOP”);}//endofInitFlashf)★User1slinkercoirjnandfi
7、leSECTIONS{/***UserDefinedSections***/secureRamFuncs:LOAD=FLASH,PAGE=0RUN=SECURE_RAM,PAGE=0RUN_START(_secureRamFuncs_runstart)fL0A3_START(_secureRamFuncs_loadsta工t)fLOAD_END(_secureRamFuncs_loadend)}~~/★**'k*'k'k'k*'k*W*'k*'k*'k*'k***'k*'k***********'k*'k*'k*'k'k*********'k***'k********ak*User1sC-s
8、ourcefile★**★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★責★★★★/irincludeexternunsignedintexrernunsignedintexternunsignedintsecureRamFuncs_loadstart;secureRamFuncs_loadend;secureRamFuncs_runstart;voidmain(void){^/★CopythesecureRamFuncssection*/ir.emcpy(&secureRair.Funcs_runstart#&secureRar.Funcs_load
9、stRMt#&secureRair.Funcs_loaaend-&secureRamFuncs_loadstazrt);/*Initializetheon-chipflashregisters*/InitFlash();}1.ProgrammingtheCodeSecurityModulePasswords*File:oasswords.asm★**t*******A****icA***A***A*i*i:*
此文档下载收益归作者所有