TMS320F28035的烧写过程

[复制链接]
14273|3
手机看帖
扫描二维码
随时随地手机跟帖
kkzz|  楼主 | 2012-9-4 17:15 | 显示全部楼层 |阅读模式
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 完成烧写

相关帖子

益友电子| | 2012-9-4 17:19 | 显示全部楼层
最好有个说明图

使用特权

评论回复
liyucai| | 2021-9-15 15:40 | 显示全部楼层
谢谢分享,正在学习怎么烧写代码到 flash 中。

使用特权

评论回复
ynndmalh21| | 2021-10-27 15:33 | 显示全部楼层
烧写到flash中,就可以了,很棒了。

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

315

主题

10626

帖子

13

粉丝