TMS320X28035的烧写过程

2019-08-06 14:26发布

TMS320X28035是TI公司2009年新推出的60M控制芯片,其烧写过程如下:
1.使用TI官方CMD文件F28035.CMD,和烧写有关的语句为:
RAML0 : origin = 0x008000, length = 0x000800
FLASHD : origin = 0x3F0000, length = 0x002000
ramfuncs : LOAD = FLASHD,
RUN = RAML0,
LOAD_START(_RamfuncsLoadStart),
LOAD_END(_RamfuncsLoadEnd),
RUN_START(_RamfuncsRunStart),
PAGE = 0
2.在工程中添加DSP2803x_MemCopy.c文件,内容如下:
#include "DSP2803x_Device.h"
void MemCopy(Uint16 *SourceAddr, Uint16* SourceEndAddr, Uint16* DestAddr)
{
while(SourceAddr < SourceEndAddr)
{
*DestAddr++ = *SourceAddr++;
}
return;
}
3.在DSP2803x_SysCtrl.c文件中添加如下语句:
#pragma CODE_SECTION(InitFlash, "ramfuncs");
void InitFlash(void)
{
EALLOW;
//Enable Flash Pipeline mode to improve performance
//of code executed from Flash.
FlashRegs.FOPT.bit.ENPIPE = 1;
// CAUTION
//Minimum waitstates required for the flash operating
//at a given CPU rate must be characterized by TI.
//Refer to the datasheet for the latest information.
//Set the Paged Waitstate for the Flash
FlashRegs.FBANKWAIT.bit.PAGEWAIT = 2;
//Set the Random Waitstate for the Flash
FlashRegs.FBANKWAIT.bit.RANDWAIT = 2;
//Set the Waitstate for the OTP
FlashRegs.FOTPWAIT.bit.OTPWAIT = 2;
// CAUTION
//ONLY THE DEFAULT VALUE FOR THESE 2 REGISTERS SHOULD BE USED
FlashRegs.FSTDBYWAIT.bit.STDBYWAIT = 0x01FF;
FlashRegs.FACTIVEWAIT.bit.ACTIVEWAIT = 0x01FF;
EDIS;
//Force a pipeline flush to ensure that the write to
//the last register configured occurs before returning.
asm(" RPT #7 || NOP");
}
4.在main()函数之前定义三个变量:
extern Uint16 RamfuncsLoadStart;
extern Uint16 RamfuncsLoadEnd;
extern Uint16 RamfuncsRunStart;
5.在main()函数初始化系统以后增加如下语句:
MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart);
InitFlash();
6.在CCS中点Tools>F28xx on-Chip Flash Programmer>Execute Pperation 完成烧写
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
2条回答
zfpmsn
1楼-- · 2019-08-06 17:30
谢谢楼主啊
zhangmangui
2楼-- · 2019-08-06 19:16
 精彩回答 2  元偷偷看……

一周热门 更多>