DSP_CMD_整理

1.       COFF格式

1>     通用目标文件格式(Common Object File Format)是一种流行的二进制可执行文件格式,二进制可执行文件包括库文件(lib),目标文件(obj)最终可执行文件(out)。,现今PC机上的Windows95NT4.0以后的操作系统的二进制文件格式(PE)就是在COFF格式基础上的进一步扩充。

2>     COFF格式:详细的COFF文件格式包括段头,可执行代码和初始化数据,可重定位信息,行号入口,符号表,字符串表等,这些属于编写操作系统和编译器人员关心范畴。而对于C只需要了解定义段和给段分配空间就可以了。

3>     采用COFF更有利于模块化编程,程序员可以自由决定愿意把哪些代码归属到哪些段,然后加以不同的处理。

2.       Section目标文件中最小单位称为块。一个块就是最终在存储器映象中占据连续空间的一段代码或数据。

1>     COFF目标文件包含三个默认的块:

.text可执行代码

.data已初始化数据

.bss为未初始化数据保留的空间

2>     汇编器对块的处理

未初始化块

                        .bss       变量存放空间

                        .usect    用户自定义的未初始化段

初始化块

                        .text      汇编指令代码

                        .data     常数数据(比如对变量的初始化数据)

                        .sect      用户自定义的已初始化段

                        .asect    .sect,多了绝对地址定位功能,一般不用

 

 3>C语言的段

未初始化块(data

                        .bss       存放全局和静态变量

                        .ebss     长调用的.bss(超过了64K地址限制)

                        .stack    存放C语言的栈

                        .sysmem存放C语言的堆

                        .esysmem     长调用的.sysmem(超过了64K地址限制)

初始化块

                        .text      可执行代码和常数(program)

                        .switch  switch语句产生的常数表格(program/64K数据空间)

                                           .pinit     Tablesfor global constructors (C++)(program)

                        .cinit     用来存放对全局和静态变量的初始化常数值(program)

                        .const    全局和静态的const变量初始化值和字符串常数,(data

                        .econst.const(可定位到任何地方)(data

3>     自定义段(C语言)

CCS编程中,如果我们不指定变量的存放位置,编译器会自动的给变量分配一个位置,但是如果有的时候需要把变量放在一个特定的空间内,我们应该如何操作呢,CCS提供了如下的两个指令
#pragma CODE_SECTION
#pragma DATA_SECTION
其中data_section是针对数据空间的,code_section是针对程序空间的,具体的使用办法是
#pragma DATA_SECTION(bufferB, ”my_sect”)
char bufferB[512];
.cmd文件中建立对应的section就可以使用了。

#pragma DATA_SECTION(函数名或全局变量名,"用户自定义在数据空间的段名");

#pragma CODE_SECTION(函数名或全局变量名,"用户自定义在程序空间的段名");

注意    

不能在函数体内声明。

必须在定义和使用前声明

#pragma可以阻止对未调用的函数的优化

3.       连接命令文件(CMD

它是用来分配romram空间用的,告诉链接程序怎样计算地址和分配空间.所以不同的芯片就有不同大小的romram.放用户程序的地方也不尽相同.所以要根据芯片进行修改.分两部分.MEMORYSECTIONS.

(1):存储器(MEMORY)伪指令,用来定义目标系统的存储器空间。MEMORY可以定义存储器的区域,并指定起始地址和长度。
(2):段(SECTOINS)伪指令,告诉链接器如何将输入段结合成输出段并告诉链接器将输出段放在存储器的何处。
MEMORY
伪指令的一般语法:
MEMORY
{
  PAGE 0: name1[(attr)]     origin=constant,length=constant;
  PAGE n: name1[(attr)]     origin=constant,length=constant;
}
PAGEn
中的页号n最大为255。每个PAGE代表一个完全独立的地址空间。通常PAGE0为程序存储器,PAGE1为数据存储器。
Name1
:存储器区间名。可包含8个字符。不同PAGE可以取同样的name1,但在同一个PAGE内区间名不可以相同。
Attr:
可选项。规定存储器属性。
R
,可以对存储器执行读操作
W
,可以对存储器执行写操作
X
,破除可以装入可执行的程序代码
I
,规定可以对存储器进行初始化
Origin
:起始地址。
Length
:区间长度。
初始化段用SECTIONS可定位两次:装入和运行。如:一些关键的执行代码必须装在系统的ROM中,但希望在较快的RAM中运行。
未初始化段只可被定位一次。

1MEMORY是用来指定芯片的romram的大小和划分出几个区间.

例如:

MEMORY
{
    VECS:       o =0x10800000  l = 0x00000200
    BOOT:       o =0x10800200  l = 0x00000200
    IRAM:       o =0x10800400  l = 0x0001FA00
    DDR2:       o =0x80000000  l = 0x10000000
}

其中ol参数反映了该区间的起始地址和长度。

2SECTIONS

在程序里添加下面的段名如.vectors.用来指定该段名以下,另一个段名以上的程序放到“>”符号后的空间名字所在的地方。

例如

SECTIONS
{
    .bss        >   IRAM
    .cinit      >   IRAM
    .cio        >   IRAM
    .const      >   DDR2
    .data       >   IRAM
    .far        >   IRAM
    .stack      >   IRAM
    .switch     >   IRAM
    .sysmem     >   IRAM
    .text       >   IRAM
    .ddr2       >   DDR2
}

3>     直接写编译命令

-lrts2800_ml.lib     连接系统文件rts2800_ml.lib

-ofilename.out              最终生成的二进制文件命名为filename.out

-m filename.map     生成映射文件filename.map

-stack0x200           堆栈为512

   4. .const段:

      由关键字const限定的全局变量(const限定的局部变量不产生)初始化值,和出现在表达式(做指针使用,而用来初始化字符串数组变量不产生)中的字符串常数,另外数组和结构体是局部变量时,其初始值会产生.const段,而全局时不产生。

C语言中

#define BUF_SIZE   1024 

#pragmaDATA_SECTION(DMABuf1,"DMARAML4");

#pragma DATA_SECTION(DMABuf2,"ZONE7DATA");

volatile Uint16 DMABuf1[BUF_SIZE];

volatile Uint16 DMABuf2[BUF_SIZE];

再比如,配置28335从内部flash启动时,

我们预定义

#pragma CODE_SECTION(epwm1_timer_isr,"ramfuncs");

#pragma CODE_SECTION(epwm2_timer_isr,"ramfuncs");

程序中调用一个函数

// The  RamfuncsLoadStart,RamfuncsLoadEnd, and RamfuncsRunStart

// symbols are created by the linker.Refer to the  cmd file.

 MemCopy(&RamfuncsLoadStart,&RamfuncsLoadEnd, &RamfuncsRunStart);

定义如下

void MemCopy(Uint16 *SourceAddr, Uint16*SourceEndAddr, Uint16* DestAddr)

{

    while(SourceAddr< SourceEndAddr)

    { 

       *DestAddr++= *SourceAddr++;

    }

    return;

}

系统自带的段名:(选择部分)(常见于DSP28x_CodeStartBranch.asm

.reset      只包含一个32位的中断矢量,指向实时支持库rts2800_ml.lib中的C编译器导引函数,即_c_int00子程序。通常我们不用此块,而是另外创建分支指令指向开始代码。

用法如下:

SECTIONS

{

.reset           :>FLASH,      PAGE=0.   TYPE=DSECT

}     语句中的“TYPE=DSECT”用来提示编译器编译时将.reset段忽略掉。

codestart   包含一条长跳转指令,指向实时支持库rts2800_ml.lib中的C编译器导引函数,即_c_int00子程序。不同的是:如果系统的程序(.text)放在系统内部RAM中仿真运行,则本块应放入片内RAM中,如地址单元0x3F8000;如果是固化程序进FLASH,则.codestart应定位与FLASH中的其实地址为0x3F7FF6中。(一条长跳转指令占2个字)。

 ramfuncs   此程序块用于对FLASH的控制寄存器进行初始化设置。

FLASH的控制寄存器受代码安全模块CSM保护,因此如果DSP是安全的(烧写后的FLASH往往处于这种状态),则必须从受保护的RAM中执行FLASH寄存器初始化代码。

InitFlash()位于DSP281x_SysCtril.c文件中,为FLASH寄存器初始化用,将次程序放进.ramfuncs块中。

  在系统的cmd文件中有:

 SECTIONS

{

      ……

   Ramfuncs            LOAD= FLASHD, PAGE = 0        //定义输出段将会被装载到哪里

                         RUN= RAMM1, PAGE = 0          //定义输出段将会在哪里运行

                         LOAD_START(_RamfuncsLoadStart),

                         LOAD_END(_RamfuncsLoadEnd),

                         RUN_START(_RamfuncsRunStart),

      ……

  }

上例中SECTIONS段的语法如下:

SECTIONS
{
name : [property,property,……]
}
name:
输出段的名称
property
:输出段的属性:
   load
allocation(强制地址或存储空间名称)同>allocation:定义输出段将会被装载到哪里。
   run= allocation
(强制地址或存储空间名称)同>allocation:定义输出段将会在哪里运行。
另:CMD文件中只出现一个关键字loadrun时,表示两者的地址时表示两者的地址时重合的。

 

LOAD_START(_RamfuncsLoadStart)令编译器创建了一个变量RamfuncsLoadStart,该变量指向段ramfuncs的装载地址的首地址(LOAD_ START为编译伪指令,请见CCS的帮助文档);

LOAD_START(_RamfuncsLoadEnd)令编译器创建了一个变量RamfuncsLoadEnd,该变量指向段ramfuncs的装载地址的末地址(LOAD_ END为编译伪指令,请见CCS的帮助文档);

LOAD_START(_RamfuncsRunStart)令编译器创建了一个变量RamfuncsRunStart,该变量指向段ramfuncs的运行地址的首地址(LOAD_ START为编译伪指令,请见CCS的帮助文档);

C函数中,为了使用变量RamfuncsLoadStartRamfuncsLoadEndRamfuncsRunStart,必须先声明。MemCpy()位于DSP281x_MemCopy.c文件中,在对FLASH寄存器初始化时,用于将指定的FLASH中的程序段复制到指定的RAM区中。如例:

externUint16 RamfuncsLoadStart;

externUint16 RamfuncsLoadEnd;

externUint16 RamfuncsRunStart;

……

Voidmain(main)

       {

      ……

MemCopy(&RamfuncsLoadStart,&RamfuncsLoadEnd, &RamfuncsRunStart);

     InitFlash();

……

}

根据自己的经验,codestart块与reset块并没有什么用处。

    F2812DSP芯片内部有一个BOOTROM,存储着出厂前已经编制好的导引加载程序和标准数学表,同时也包含复位矢量和CPU矢量表(仅用于测试)。当DSP上电后,导引加载程序会自动配置所需要的设置,例如配置好EMIF以存取flash,配置GPIO口为把程序从外部RAMROM下载到内部RAM中做准备。

                                        ————————类似于PC的加电硬件检测

在运行C程序(main函数)之前,必须创建C运行环境。这个任务由C引导程序(BOOTRAM中固化的导引加载程序)使用名为c_int00()的子程序来执行。此函数位于rts.lib文件中。

在系统开始运行时,c_int00()可以被调用,通常由硬件复位来调用。必须将c_int00()与其他的目标模块连接起来,当使用C连接器并且包含rts28xx.lib作为连接器输入文件时,以上调用自动实现。当连接C程序时,连接器将可执行输出模块中的入口点的值赋给c_int00()函数,这些可执行输出模块不尽相同,但最为人关心的则是由c_int00()来启动main()函数运行自己的C程序。

而在 .codestart  .reset代码块的编写的汇编程序的功能也仅仅是引导BOOTROM中的导引加载程序与c_int00()函数的衔接。

 

/*
TI 28335	CMD 整理

在CMD文件中写注释,必须使用来分隔,不允许用//,这点和C语言不同
*/
/* ======================================================
// 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 DSP2833x_Headers_nonBIOS.cmd */

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

/* 2) In your project add the path to <base>\DSP2833x_headers\cmd to the
   library search path under project->build options, linker tab, 
   library search path (-i).
/*========================================================= */

/* Define the memory block start/length for the F28335  
   PAGE 0 will be used to organize program sections
   PAGE 1 will be used to organize data sections

    Notes: 
          Memory blocks on F28335 are uniform (ie same
          physical memory) in both PAGE 0 and PAGE 1.  
          That is the same memory region should not be
          defined for both PAGE 0 and PAGE 1.
          Doing so will result in corruption of program 
          and/or data. 
          
          L0/L1/L2 and L3 memory blocks are mirrored - that is
          they can be accessed in high memory or low memory.
          For simplicity only one instance is used in this
          linker file. 
          
          Contiguous SARAM memory blocks can be combined 
          if required to create a larger memory block. 
 */


MEMORY
{
PAGE 0:    /* Program Memory */
           /* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE1 for data allocation */

   ZONE0       : origin = 0x004000, length = 0x001000     /* XINTF zone 0 */
   RAML0       : origin = 0x008000, length = 0x001000     /* on-chip RAM block L0 */
   RAML1       : origin = 0x009000, length = 0x001000     /* on-chip RAM block L1 */
   RAML2       : origin = 0x00A000, length = 0x001000     /* on-chip RAM block L2 */
   RAML3       : origin = 0x00B000, length = 0x001000     /* on-chip RAM block L3 */
   ZONE6A      : origin = 0x100000, length = 0x00FC00    /* XINTF zone 6 - program space*/ 
   ZONE7       : origin = 0x200000, length = 0x100000    /* XINTF zone 7  */ 
   FLASHH      : origin = 0x300000, length = 0x008000     /* on-chip FLASH */
   FLASHG      : origin = 0x308000, length = 0x008000     /* on-chip FLASH */
   FLASHF      : origin = 0x310000, length = 0x008000     /* on-chip FLASH */
   FLASHE      : origin = 0x318000, length = 0x008000     /* on-chip FLASH */
   FLASHD      : origin = 0x320000, length = 0x008000     /* on-chip FLASH */
   FLASHC      : origin = 0x328000, length = 0x008000     /* on-chip FLASH */
   FLASHA      : origin = 0x338000, length = 0x007F80     /* on-chip FLASH */
   CSM_RSVD    : origin = 0x33FF80, length = 0x000076     /* Part of FLASHA.  Program with all 0x0000 when CSM is in use. */
   BEGIN       : origin = 0x33FFF6, length = 0x000002     /* Part of FLASHA.  Used for "boot to Flash" bootloader mode. */
   CSM_PWL     : origin = 0x33FFF8, length = 0x000008     /* Part of FLASHA.  CSM password locations in FLASHA */
   OTP         : origin = 0x380400, length = 0x000400     /* on-chip OTP */
   ADC_CAL     : origin = 0x380080, length = 0x000009     /* ADC_cal function in Reserved memory */
   
   IQTABLES    : origin = 0x3FE000, length = 0x000b50     /* IQ Math Tables in Boot ROM */
   IQTABLES2   : origin = 0x3FEB50, length = 0x00008c     /* IQ Math Tables in Boot ROM */  
   FPUTABLES   : origin = 0x3FEBDC, length = 0x0006A0     /* FPU Tables in Boot ROM */
   ROM         : origin = 0x3FF27C, length = 0x000D44     /* Boot ROM */        
   RESET       : origin = 0x3FFFC0, length = 0x000002     /* part of boot ROM  */
   VECTORS     : origin = 0x3FFFC2, length = 0x00003E     /* part of boot ROM  */

PAGE 1 :   /* Data Memory */
           /* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE0 for program allocation */
           /* Registers remain on PAGE1                                                  */
   
   BOOT_RSVD   : origin = 0x000000, length = 0x000050     /* Part of M0, BOOT rom will use this for stack */
   RAMM0       : origin = 0x000050, length = 0x0003B0     /* on-chip RAM block M0 */
   RAMM1       : origin = 0x000400, length = 0x000400     /* on-chip RAM block M1 */
   RAML4       : origin = 0x00C000, length = 0x001000     /* on-chip RAM block L1 */
   RAML5       : origin = 0x00D000, length = 0x001000     /* on-chip RAM block L1 */
   RAML6       : origin = 0x00E000, length = 0x001000     /* on-chip RAM block L1 */
   RAML7       : origin = 0x00F000, length = 0x001000     /* on-chip RAM block L1 */
   ZONE6B      : origin = 0x10FC00, length = 0x000400     /* XINTF zone 6 - data space */
   FLASHB      : origin = 0x330000, length = 0x008000     /* on-chip FLASH */

   DEV_EMU     : origin = 0x000880, length = 0x000180     /* device emulation registers */
   FLASH_REGS  : origin = 0x000A80, length = 0x000060     /* FLASH registers */
   CSM         : origin = 0x000AE0, length = 0x000010     /* code security module registers */
  
   ADC_MIRROR  : origin = 0x000B00, length = 0x000010     /* ADC Results register mirror */

   XINTF       : origin = 0x000B20, length = 0x000020     /* external interface registers */
   
   CPU_TIMER0  : origin = 0x000C00, length = 0x000008     /* CPU Timer0 registers */
   CPU_TIMER1  : origin = 0x000C08, length = 0x000008     /* CPU Timer0 registers (CPU Timer1 & Timer2 reserved TI use)*/
   CPU_TIMER2  : origin = 0x000C10, length = 0x000008     /* CPU Timer0 registers (CPU Timer1 & Timer2 reserved TI use)*/

   PIE_CTRL    : origin = 0x000CE0, length = 0x000020     /* PIE control registers */
   PIE_VECT    : origin = 0x000D00, length = 0x000100     /* PIE Vector Table */

   DMA         : origin = 0x001000, length = 0x000200     /* DMA Rev 0 registers */

   MCBSPA      : origin = 0x005000, length = 0x000040     /* McBSP-A registers */
   MCBSPB      : origin = 0x005040, length = 0x000040     /* McBSP-B registers */

   ECANA       : origin = 0x006000, length = 0x000040     /* eCAN-A control and status registers */ 
   ECANA_LAM   : origin = 0x006040, length = 0x000040     /* eCAN-A local acceptance masks */
   ECANA_MOTS  : origin = 0x006080, length = 0x000040     /* eCAN-A message object time stamps */
   ECANA_MOTO  : origin = 0x0060C0, length = 0x000040     /* eCAN-A object time-out registers */
   ECANA_MBOX  : origin = 0x006100, length = 0x000100     /* eCAN-A mailboxes */

   ECANB       : origin = 0x006200, length = 0x000040     /* eCAN-B control and status registers */ 
   ECANB_LAM   : origin = 0x006240, length = 0x000040     /* eCAN-B local acceptance masks */
   ECANB_MOTS  : origin = 0x006280, length = 0x000040     /* eCAN-B message object time stamps */
   ECANB_MOTO  : origin = 0x0062C0, length = 0x000040     /* eCAN-B object time-out registers */
   ECANB_MBOX  : origin = 0x006300, length = 0x000100     /* eCAN-B mailboxes */

   EPWM1       : origin = 0x006800, length = 0x000022     /* Enhanced PWM 1 registers */
   EPWM2       : origin = 0x006840, length = 0x000022     /* Enhanced PWM 2 registers */
   EPWM3       : origin = 0x006880, length = 0x000022     /* Enhanced PWM 3 registers */
   EPWM4       : origin = 0x0068C0, length = 0x000022     /* Enhanced PWM 4 registers */
   EPWM5       : origin = 0x006900, length = 0x000022     /* Enhanced PWM 5 registers */
   EPWM6       : origin = 0x006940, length = 0x000022     /* Enhanced PWM 6 registers */

   ECAP1       : origin = 0x006A00, length = 0x000020     /* Enhanced Capture 1 registers */
   ECAP2       : origin = 0x006A20, length = 0x000020     /* Enhanced Capture 2 registers */
   ECAP3       : origin = 0x006A40, length = 0x000020     /* Enhanced Capture 3 registers */
   ECAP4       : origin = 0x006A60, length = 0x000020     /* Enhanced Capture 4 registers */         
   ECAP5       : origin = 0x006A80, length = 0x000020     /* Enhanced Capture 5 registers */         
   ECAP6       : origin = 0x006AA0, length = 0x000020     /* Enhanced Capture 6 registers */         
 
   EQEP1       : origin = 0x006B00, length = 0x000040     /* Enhanced QEP 1 registers */
   EQEP2       : origin = 0x006B40, length = 0x000040     /* Enhanced QEP 2 registers */   

   GPIOCTRL    : origin = 0x006F80, length = 0x000040     /* GPIO control registers */
   GPIODAT     : origin = 0x006FC0, length = 0x000020     /* GPIO data registers */
   GPIOINT     : origin = 0x006FE0, length = 0x000020     /* GPIO interrupt/LPM registers */
                 
   SYSTEM      : origin = 0x007010, length = 0x000020     /* System control registers */
   SPIA        : origin = 0x007040, length = 0x000010     /* SPI-A registers */
   SCIA        : origin = 0x007050, length = 0x000010     /* SCI-A registers */
   XINTRUPT    : origin = 0x007070, length = 0x000010     /* external interrupt registers */

   ADC         : origin = 0x007100, length = 0x000020     /* ADC registers */

   SCIB        : origin = 0x007750, length = 0x000010     /* SCI-B registers */

   SCIC        : origin = 0x007770, length = 0x000010     /* SCI-C registers */
   
   I2CA        : origin = 0x007900, length = 0x000040     /* I2C-A registers */
   
   CSM_PWL     : origin = 0x33FFF8, length = 0x000008     /* Part of FLASHA.  CSM password locations. */

   
}

/* Allocate sections to memory blocks.
   Note:
         codestart user defined section in DSP28_CodeStartBranch.asm used to redirect code 
                   execution when booting to flash
         ramfuncs  user defined section to store functions that will be copied from Flash into RAM
*/ 
 
SECTIONS
{
     /* The Flash API functions can be grouped together as shown below.
    The defined symbols _Flash28_API_LoadStart, _Flash28_API_LoadEnd
    and _Flash28_API_RunStart are used to copy the API functions out
    of flash memory and into SARAM*/

    Flash28_API:
    {
        -lFlash28335_API_V210.lib(.econst) 
        -lFlash28335_API_V210.lib(.text)
    }                       LOAD = FLASHHG, 
                            RUN = RAML0, 
                            LOAD_START(_Flash28_API_LoadStart),
                            LOAD_END(_Flash28_API_LoadEnd),
                            RUN_START(_Flash28_API_RunStart),
                            PAGE = 0
							
   /* Allocate program areas: */
   /* Setup for "boot to FLASH" mode:
    The codestart section (found in CodeStartBranch.asm)
    re-directs execution to the start of user code.
    Place this section or the .text section at the
    start of FLASH */
   .cinit              : > FLASHA      PAGE = 0	/*包含了初始化变量和常量所用的表格,是只读的。*/
   .pinit              : > FLASHA,     PAGE = 0	/*包含了初始化变量和常量所用的表格,是只读的。*/
   .text               : > FLASHA      PAGE = 0	/*通常是只读的,包含所有可执行的代码,以及编译器编译产生的常量*/
   codestart           : > BEGIN       PAGE = 0
   
   /* Runin RAM functions, copy from load address to run address */
   ramfuncs            : LOAD = FLASHD, 
                         RUN = RAML0, 
                         LOAD_START(_RamfuncsLoadStart),
                         LOAD_END(_RamfuncsLoadEnd),
                         RUN_START(_RamfuncsRunStart),
                         PAGE = 0

   csmpasswds          : > CSM_PWL     PAGE = 0
   csm_rsvd            : > CSM_RSVD    PAGE = 0
   
   /* Allocate uninitalized data sections: */
   .stack              : > RAMM1       PAGE = 1
 /*  默认情况下,栈(stack)保存在.stack段中(参考boot.asm),这个段用来为栈保留存储空间。栈(stack)的作用主要有:

1) 保留存储空间用于存储传递给函数的参数;

2) 为局部变量分配相关的地址空间;

3) 保存处理器的状态;

4) 保存函数的返回地址;

5) 保存某些临时变量的值。

需要注意的是,.stack段只能使用低64K地址的数据存储单元,因为CPU的SP寄存器是16位的,
它无法读取超过64K的地址范围。此外,编译器无法检查栈的溢出错误(除非我们自己编写某些代码来检测),
这将导致错误的输出结果,所以要为栈分配一个相对较大的存储空间,它的默认值是1K字。
改变栈的大小的操作可以通过编译器选项--stack_size来完成。
*/
   .bss                : > RAML4,      PAGE = 1		/*为全局和静态变量保留存储空间。
							在启动或者程序加载的时候,
							C/C++的启动程序会把.cinit段中的数据
							(一般存放在ROM中)复制到.bss段中。*/
   .ebss               : > RAML4       PAGE = 1		/*为far关键字定义(仅适用于C代码)
							的全局和静态变量保留存储空间。
							在启动或者程序加载的时候,
							C/C++的启动程序会把.cinit段中的数据
							(一般存放在ROM中)复制到.ebss段中*/
   .esysmem            : > RAMM1       PAGE = 1		/*为far malloc函数分配动态存储空间。如果没有用到这个函数,则编译器不会自动创建.esysmem段。*/

   /* Initalized sections go in Flash */
   /* For SDFlash to program these, they must be allocated to page 0 */
    .const              : > FLASHA,     PAGE = 0	/*包含了字符串常量、字符串文字、浮点常量
							选择表以及使用const关键字定义
							(但是不包括volatile类型,并假设使用小内存模型)
							的只读型变量*/
    .econst             : > FLASHA,     PAGE = 0	/*包含了字符串常量,以及使用far关键字定义的全局变量和静态变量*/
    .switch             : > FLASHA,     PAGE = 0	/*存放switch-case指令所使用的选择表。*/
    codestart           : > BEGIN,       PAGE = 0   

   /* Allocate IQ math areas: */
   IQmath              : > FLASHC      PAGE = 0                  /* Math Code */
   IQmathTables     : > IQTABLES,  PAGE = 0, TYPE = NOLOAD 
   IQmathTables2    : > IQTABLES2, PAGE = 0, TYPE = NOLOAD 
   FPUmathTables    : > FPUTABLES, PAGE = 0, TYPE = NOLOAD 
         
   /* Allocate DMA-accessible RAM sections: */
   DMARAML4         : > RAML4,     PAGE = 1
   DMARAML5         : > RAML5,     PAGE = 1
   DMARAML6         : > RAML6,     PAGE = 1
   DMARAML7         : > RAML7,     PAGE = 1
   
   /* Allocate 0x400 of XINTF Zone 6 to storing data */
   ZONE6DATA        : > ZONE6B,    PAGE = 1

   /* .reset is a standard section used by the compiler.  It contains the */ 
   /* the address of the start of _c_int00 for C Code.   /*
   /* When using the boot ROM this section and the CPU vector */
   /* table is not needed.  Thus the default type is set here to  */
   /* DSECT  */ 
   .reset              : > RESET,      PAGE = 0, TYPE = DSECT
   vectors             : > VECTORS     PAGE = 0, TYPE = DSECT
   
   /* Allocate ADC_cal function (pre-programmed by factory into TI reserved memory) */
   .adc_cal     : load = ADC_CAL,   PAGE = 0, TYPE = NOLOAD

   
   
   PieVectTableFile : > PIE_VECT,   PAGE = 1

/*** Peripheral Frame 0 Register Structures ***/
   DevEmuRegsFile    : > DEV_EMU,     PAGE = 1
   FlashRegsFile     : > FLASH_REGS,  PAGE = 1
   CsmRegsFile       : > CSM,         PAGE = 1
   AdcMirrorFile     : > ADC_MIRROR,  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     
   DmaRegsFile       : > DMA,         PAGE = 1 

/*** Peripheral Frame 3 Register Structures ***/
   McbspaRegsFile    : > MCBSPA,      PAGE = 1
   McbspbRegsFile    : > MCBSPB,      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
   
   ECanbRegsFile     : > ECANB,       PAGE = 1
   ECanbLAMRegsFile  : > ECANB_LAM    PAGE = 1   
   ECanbMboxesFile   : > ECANB_MBOX   PAGE = 1
   ECanbMOTSRegsFile : > ECANB_MOTS   PAGE = 1
   ECanbMOTORegsFile : > ECANB_MOTO   PAGE = 1
   
   EPwm1RegsFile     : > EPWM1        PAGE = 1   
   EPwm2RegsFile     : > EPWM2        PAGE = 1   
   EPwm3RegsFile     : > EPWM3        PAGE = 1   
   EPwm4RegsFile     : > EPWM4        PAGE = 1   
   EPwm5RegsFile     : > EPWM5        PAGE = 1   
   EPwm6RegsFile     : > EPWM6        PAGE = 1
   
   ECap1RegsFile     : > ECAP1        PAGE = 1   
   ECap2RegsFile     : > ECAP2        PAGE = 1   
   ECap3RegsFile     : > ECAP3        PAGE = 1   
   ECap4RegsFile     : > ECAP4        PAGE = 1
   ECap5RegsFile     : > ECAP5        PAGE = 1   
   ECap6RegsFile     : > ECAP6        PAGE = 1

   EQep1RegsFile     : > EQEP1        PAGE = 1   
   EQep2RegsFile     : > EQEP2        PAGE = 1               

   GpioCtrlRegsFile  : > GPIOCTRL     PAGE = 1
   GpioDataRegsFile  : > GPIODAT      PAGE = 1
   GpioIntRegsFile   : > GPIOINT      PAGE = 1
   
/*** Peripheral Frame 2 Register Structures ***/
   SysCtrlRegsFile   : > SYSTEM,      PAGE = 1
   SpiaRegsFile      : > SPIA,        PAGE = 1
   SciaRegsFile      : > SCIA,        PAGE = 1
   XIntruptRegsFile  : > XINTRUPT,    PAGE = 1
   AdcRegsFile       : > ADC,         PAGE = 1
   ScibRegsFile      : > SCIB,        PAGE = 1
   ScicRegsFile      : > SCIC,        PAGE = 1
   I2caRegsFile      : > I2CA,        PAGE = 1
              
/*** Code Security Module Register Structures ***/
   CsmPwlFile        : > CSM_PWL,     PAGE = 1
   
}

/*
//===========================================================================
// End of file.
//===========================================================================
*/



  • 0
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值