DSP2812 FLASH烧写

2019-08-02 09:58

1. 一定要下载最新的FLASH烧写插件,可以避免很多奇怪的错误出现,这一点非常重要,本人就是在此问题困扰了一整天。 名称是:

C2000-2[1][1].00-SA-to-UA-TI-FLASH2X.EXE 我使用的产品版本号为2.02.001

2. 下载烧写FLASH配套CMD文件、LIB文件以及起始代码asm文件。 CMD文件名称:DSP281x_Headers_nonBIOS.cmd CMD文件名称:F2812.cmd LIB文件名称:rts2800_ml.lib

ASM文件名称:DSP281x_CodeStartBranch.asm 另外在RAM调试时用以下两个文件: F2812_EzDSP_RAM_lnk.cmd DSP281x_Headers_nonBIOS.cmd

附件给出了2个CMD文件、ASM文件、LIB文件以及C文件。 其中C文件仅仅作为大家参考。

3. 配置C文件

配置好主程序的C文件,才能将FLASH成功烧录,并且将FLASH中的文件拷贝到RAM中运行。 关于C文件的配置。

首先在F2812.CMD文件中,我们可以看到有关于加载FLASH到RAM的内容:

ramfuncs : LOAD = FLASHD, RUN = RAML0,

LOAD_START(_RamfuncsLoadStart), LOAD_END(_RamfuncsLoadEnd), RUN_START(_RamfuncsRunStart), PAGE = 0

以及在C文件中调用FLASH 到RAM的函数memcpy,将它放在系统初始化(InitSystem();)之后即可: InitSystem();

memcpy(&RamfuncsRunStart, &RamfuncsLoadStart,

&RamfuncsLoadEnd - &RamfuncsLoadStart);

Initflash();

所以,我们需要定义所用变量:

extern Uint16 RamfuncsLoadStart; extern Uint16 RamfuncsLoadEnd; extern Uint16 RamfuncsRunStart;

我的这些定义都是:DSP281x_GlobalPrototypes.h 当中,当然,也可以放在其他系统初始化的地方。

Memcpy这个函数应该是rts2800_ml.lib库文件中自带的,不需要我们定义。

关于FLASH的初始化配置Initflash();

我把它放置在Memcpy函数之后。

关于ramfuncs,则在系统初始化中定义即可。如:sysctrl.c中

#pragma CODE_SECTION(InitFlash, \

另外,许多朋友没有注意需要定义自己其他子程序,导致最终运行的主程序还是在FLASH中,比如你需要运行的子程序ABC,则需要定义#pragma CODE_SECTION(ABC, \

烧写成功后的注意事项:

1. 一定要拔除仿真器(JTAG端),给电路板重新上电,方能实现FLASH启动。

2. 注意MP/MC引脚的电压。0为方式MC来作为计算机模式启动,3.3V为方式MP作为微处理器模式启动。

3. 由于GPIO引脚的F4F12F3F2决定了DSP2812的启动顺序,而从FLASH必须要在F4(SCITXDA)为1,而F12F3F2随意的状态下启动。请大家启动前确认F4引脚电压。

/*

// TI File $Revision: /main/4 $

// Checkin $Date: July 9, 2009 17:39:29 $

//########################################################################### //

// FILE: DSP281x_Headers_nonBIOS.cmd //

// TITLE: DSP281x Peripheral registers linker command file //

// DESCRIPTION: //

// This file is for use in Non-BIOS applications. //

// Linker command file to place the peripheral structures // used within the DSP28 headerfiles into the correct memory // mapped locations. //

// This version of the file includes the PieVectorTable structure.

// For BIOS applications, please use the DSP281x_Headers_BIOS.cmd file // which does not include the PieVectorTable structure. //

//###########################################################################

// $TI Release: DSP281x C/C++ Header Files V1.20 $ // $Release Date: July 27, 2009 $

//########################################################################### */

MEMORY {

PAGE 0: /* Program Memory */

PAGE 1: /* Data Memory */

DEV_EMU : origin = 0x000880, length = 0x000180 /* device emulation registers */

PIE_VECT : origin = 0x000D00, length = 0x000100 /* PIE Vector Table */ FLASH_REGS : origin = 0x000A80, length = 0x000060 /* FLASH registers */

CSM : origin = 0x000AE0, length = 0x000010 /* code security module registers */

XINTF : origin = 0x000B20, length = 0x000020 /* external interface registers */ CPU_TIMER0 : origin = 0x000C00, length = 0x000008 /* CPU Timer0 registers */ CPU_TIMER1 : origin = 0x000C08, length = 0x000008 /* CPU Timer1 registers */ CPU_TIMER2 : origin = 0x000C10, length = 0x000008 /* CPU Timer2 registers */ PIE_CTRL : origin = 0x000CE0, length = 0x000020 /* PIE control registers */

ECANA : origin = 0x006000, length = 0x000040 /* eCAN control and status registers */

ECANA_LAM : origin = 0x006040, length = 0x000040 /* eCAN local acceptance masks */

ECANA_MOTS : origin = 0x006080, length = 0x000040 /* eCAN message object time stamps */

ECANA_MOTO : origin = 0x0060C0, length = 0x000040 /* eCAN object time-out registers */

ECANA_MBOX : origin = 0x006100, length = 0x000100 /* eCAN mailboxes */ SYSTEM : origin = 0x007010, length = 0x000020 /* System control registers */ SPIA : origin = 0x007040, length = 0x000010 /* SPI registers */ SCIA : origin = 0x007050, length = 0x000010 /* SCI-A registers */

XINTRUPT : origin = 0x007070, length = 0x000010 /* external interrupt registers */

GPIOMUX : origin = 0x0070C0, length = 0x000020 /* GPIO mux registers */ GPIODAT : origin = 0x0070E0, length = 0x000020 /* GPIO data registers */ ADC : origin = 0x007100, length = 0x000020 /* ADC registers */

EVA : origin = 0x007400, length = 0x000040 /* Event Manager A registers */ EVB : origin = 0x007500, length = 0x000040 /* Event Manager B registers */ SCIB : origin = 0x007750, length = 0x000010 /* SCI-B registers */ MCBSPA : origin = 0x007800, length = 0x000040 /* McBSP registers */

CSM_PWL : origin = 0x3F7FF8, length = 0x000008 /* Part of FLASHA. CSM

password locations. */ }

SECTIONS {

PieVectTableFile : > PIE_VECT, PAGE = 1

/*** Peripheral Frame 0 Register Structures ***/

DevEmuRegsFile : > DEV_EMU, PAGE = 1 FlashRegsFile : > FLASH_REGS, PAGE = 1 CsmRegsFile : > CSM, PAGE = 1 XintfRegsFile : > XINTF, PAGE = 1 CpuTimer0RegsFile : > CPU_TIMER0, PAGE = 1 CpuTimer1RegsFile : > CPU_TIMER1, PAGE = 1 CpuTimer2RegsFile : > CPU_TIMER2, PAGE = 1 PieCtrlRegsFile : > PIE_CTRL, PAGE = 1

/*** Peripheral Frame 1 Register Structures ***/

ECanaRegsFile : > ECANA, PAGE = 1

ECanaLAMRegsFile : > ECANA_LAM PAGE = 1 ECanaMboxesFile : > ECANA_MBOX PAGE = 1 ECanaMOTSRegsFile : > ECANA_MOTS PAGE = 1 ECanaMOTORegsFile : > ECANA_MOTO PAGE = 1

/*** Peripheral Frame 2 Register Structures ***/

SysCtrlRegsFile : > SYSTEM, PAGE = 1 SpiaRegsFile : > SPIA, PAGE = 1 SciaRegsFile : > SCIA, PAGE = 1 XIntruptRegsFile : > XINTRUPT, PAGE = 1 GpioMuxRegsFile : > GPIOMUX, PAGE = 1 GpioDataRegsFile : > GPIODAT PAGE = 1 AdcRegsFile : > ADC, PAGE = 1 EvaRegsFile : > EVA, PAGE = 1 EvbRegsFile : > EVB, PAGE = 1 ScibRegsFile : > SCIB, PAGE = 1 McbspaRegsFile : > MCBSPA, PAGE = 1

/*** Code Security Module Register Structures ***/

CsmPwlFile : > CSM_PWL, PAGE = 1 }

/******************* end of file ************************/

/*

// TI File $Revision: /main/3 $

// Checkin $Date: April 23, 2007 09:09:27 $

//########################################################################### //

// FILE: F2812_EzDSP_RAM_lnk.cmd //

// TITLE: Linker Command File For F2812 eZdsp examples that run out of RAM // This linker file assumes the user is booting up in Jump to H0 mode //

//########################################################################### // $TI Release: DSP281x C/C++ Header Files V1.20 $ // $Release Date: July 27, 2009 $

//########################################################################### */

/* ====================================================== // For Code Composer Studio V2.2 and later // ---------------------------------------

// In addition to this memory linker command file,

// add the header linker command file directly to the project. // The header linker command file is required to link the // peripheral structures to the proper locations within // the memory map. //

// The header linker files are found in \\DSP281x_Headers\\cmd //

// For BIOS applications add: DSP281x_Headers_BIOS.cmd

// For nonBIOS applications add: DSP281x_Headers_nonBIOS.cmd

========================================================= */

/* ====================================================== // For Code Composer Studio prior to V2.2 // --------------------------------------

// 1) Use one of the following -l statements to include the // header linker command file in the project. The header linker // file is required to link the peripheral structures to the proper

// locations within the memory map */

/* Uncomment this line to include file only for non-BIOS applications */ /* -l DSP281x_Headers_nonBIOS.cmd */

/* Uncomment this line to include file only for BIOS applications */ /* -l DSP281x_Headers_BIOS.cmd */


DSP2812 FLASH烧写.doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:时代光华《如何呈现PPT》课后答案

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: