DSP2812flash运行程序加速的方法

上传人:gg****m 文档编号:213904064 上传时间:2021-11-22 格式:DOCX 页数:7 大小:84.44KB
返回 下载 相关 举报
DSP2812flash运行程序加速的方法_第1页
第1页 / 共7页
DSP2812flash运行程序加速的方法_第2页
第2页 / 共7页
DSP2812flash运行程序加速的方法_第3页
第3页 / 共7页
DSP2812flash运行程序加速的方法_第4页
第4页 / 共7页
DSP2812flash运行程序加速的方法_第5页
第5页 / 共7页
点击查看更多>>
资源描述

《DSP2812flash运行程序加速的方法》由会员分享,可在线阅读,更多相关《DSP2812flash运行程序加速的方法(7页珍藏版)》请在金锄头文库上搜索。

1、日期:2009.3.11 上午 9: 49刚刚把2812内部flash运行程序加速调试通了,结果比较成功。为了以后少走弯路,把刚才的调试过程记录一下。参考的资料是TI 的 Running an Application from Internal Flash Memory on the TMS320F28xxx DSP,文档编号是 SPRA958H。由于我是采用的自己编写CMD的方式,所以工程属于Non-DSP/BIOS Projects o内部flash运行加速需要添加的文件有CodeStartBranch.asm, Passwords.asm, DSP281 x_MemCopy.c,另外还需

2、要有void InitFlash(void)函数完成对FLASH的初始化配置。1. Initializing the Flash Control Registers (DSP/BIOS and non-DSP/BIOS projects)pragma CODE_SECTIOK (InitFlash, fsecureRairrjncsn) void InitFlash(void)asm(n EALLOW11);FlashRegs.FPWR.bit.PWR 二 3;FlashRegs.FSTATJS.bit.V3STAT = 1;/ Enable EALLOW protected register

3、 access/ Flash set to active node/ Clear the 3VSTAT bit/ Sleep to standby cyclesFlashRegs.FSTEBYWAIT.bit.STDBYV?AIT 二 OxOlFF;FlashRegs. FACTIVE 祛 I? .bit .UnVEWAITOxOlFF; / Standby to active cyclesFlashRegs.FBANKWAIT.bit.RANDWAIT 二 3;FlashRegs.FBAKKWAIT.bit.PAGEWA:T = 3;FlashRegs.FOTPWAIT.b辻.OTPWAIT

4、 = 5;FlashRegs.FOPT.bit.ENPIPE = 1;/ F280x Random access wait states/ F280x Paged access wait states / F280x OTP wait states/ Enable the flash pipeline/ Disable EALLOW protected register access* Force a complete pipeline flush to ensure that the write to th? last register configured occurs before re

5、turning. Safest thing is to wait 8 full cycles. *asm(n RPT #6 | NOP”); /end of InitFlashf) User1 s linker coirjnand fileSECTIONS/* User Defined Sections */ secureRamFuncs:LOAD = FLASH,PAGE = 0RUN = SECURE_RAM, PAGE = 0RUN_START(_secureRamFuncs_runstart)f L0A3_START(_secureRamFuncs_loadsta工t)f LOAD_E

6、ND(_secureRamFuncs_loadend) /*k*kkk*k*W*k*k*k*k*k*k*k*k*k*kk*k*k*ak* User1s C-source file * *責 /irinclude extern unsigned int exrern unsigned int extern unsigned intsecureRamFuncs_loadstart; secureRamFuncs_loadend; secureRamFuncs_runstart;void main(void) / Copy the secureRamFuncs section */ir.emcpy

7、(& secureRair.Funcs_runstar t #& secur eRar.Funcs_loads tRMt#&secureRair.Funcs_loaaend - &secureRamFuncs_loadstazrt);/* Initialize the on-chip flash registers */ InitFlash();2. Programming the Code Security Module Passwords* File: oasswords.asm *t*A*icA*A*A*i*i:*t*i:* A* *女女女:*衣女女衣女女女女,丈* Dummy pass

8、words of OxFFFF are shown. The user can change these to* desired values.* CAUTION: Do not use 0x0000 for all 8 passwords or the CSM module will* be permanently locked. See References 6-8 for more information.sect passwords”.intOxFFFF;PWL0(LSWof128bit password).intOxFFFF;PWL1.intOxFFFF;PWL2.intOxFFFF

9、;PWL3.intOxFFFF;PWL4.intOxFFFF;PWL5.intOxFFFF;PV7L6.intOxFFFF;PV7L7(MSWof128-bit password).sect csm_rsvd.loop (3F7FF5h - 3F7F80h + 1) .int 0x0000.endloop;end of file passwords.asm/* User1s user Linker command file (non-DSP/3Z0S Projects)MEMORYPAGE 0:/*CSM_RSVDPASSWORDSPAGE 1:/*Program Memory */:orig

10、in = 0x3F7F80z:origin = 0x3F7FF8 PASSWORDS,csm_rsvd: CSM_RSVD, -Locations *PAGE = 0PAGE = 03. Executing Your Code from Flash after a DSP Reset andDisabling the Watchdog Timer During CEnvironment Boot* User 1s linker command file (non-DSP/BIOS Projects)會*少* * * W 勺* * * *舍0 A 0會A令A會 仲* W * * * P P A會

11、會合*會* *说* * * *令少*令舍舍* File: CodeSrartEranch.asm* Devices: Ti-!S320F28xxx* Auchcr: Da/id E. Al*err Texas IntrBjnier.t.5 Znc * Hisrory: 02/11/05 - original (D. Alter)7;2_ZZ SABLE sez 1;set to 1 zo drsable ND, else set to 0.ref c intOO0 Functi匚n: codes*art section* Description: Branch to cede starting

12、 point* A 舍 A 會 * 4r * * * O * 0 會 * 舍 Ar A 0 A * 7 * * * 舍 A 音 A 會 * 舍浚舍會* W * ir * A 習 * 0 * 舍 A sect ,fccdestar*n.if KD_DISABLE = 1 LB wd_disable .elseLB _c_intOOendif;end ccdestart sectLcn ZQXtwd_disable:_ EALLOWM6J2 DFr #7029h6出刃 37929hz40O3hEDISLB _c_int00;end wd_disable;2ranch zc watchdog dis

13、able code;Branch zc srart cf boot.asm in RTS 1.二brary合 * * W 夕 * * * W 合書 * * * t 0 A 0 t * O A 0 * 比 * 占*承*亲*/MEMORYPAGE 0:/* Program Memory */BEGIN_FLASH : origin = 0x3F7FF6, length = 0x000002PAGE 1:/* Data Memory */ * * * * , 0 會 A 仔合舍會 * * * W * W W 汝夕* O 0 A 0 * Functi匚u: wd_disable* Description: Disables the watchdog tur.er會*”/* J

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 其它办公文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号