打印

我的cmd文件有问题吗

[复制链接]
2174|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
nwttjpu|  楼主 | 2012-3-11 09:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
ST, TI, AD, start, ge
MEMORY      /* Program Memory */
{
PAGE 0 :
   FLASH      : origin = 0x3D8000, length = 0x01FF80 /* on-chip FLASH */
   BEGIN      : origin = 0x3F7FF6, length = 0x000002
   ROM        : origin = 0x3FF000, length = 0x000FC0
   RESET      : origin = 0x3FFFC0, length = 0x000002
   
   VECTORS    : origin = 0x3FFFC2, length = 0x00003E /* part of Boot ROM (MP/MCn=0) or XINTF zone 7 (MP/MCn=1) */
   
   RAML0L1    : origin = 0x008000, length = 0x002000
   RAMH0     : origin = 0x3f8000, length = 0x002000   
                          
PAGE 1 :
   /* SARAM                     */     
   RAMM0    : origin = 0x000000, length = 0x000400
   RAMM1    : origin = 0x000400, length = 0x000400
   
   /* Peripheral Frame 0:   */
   DEV_EMU    : origin = 0x000880, length = 0x000180
   FLASH_REGS : origin = 0x000A80, length = 0x000060
   CSM        : origin = 0x000AE0, length = 0x000010
   XINTF      : origin = 0x000B20, length = 0x000020
   CPU_TIMER0 : origin = 0x000C00, length = 0x000008
   CPU_TIMER1 : origin = 0x000C08, length = 0x000008   
   CPU_TIMER2 : origin = 0x000C10, length = 0x000008   
   PIE_CTRL   : origin = 0x000CE0, length = 0x000020
   PIE_VECT   : origin = 0x000D00, length = 0x000100
   /* Peripheral Frame 1:   */
   ECAN_A     : origin = 0x006000, length = 0x000100
   ECAN_AMBOX : origin = 0x006100, length = 0x000100
   /* Peripheral Frame 2:   */
   SYSTEM     : origin = 0x007010, length = 0x000020
   SPI_A      : origin = 0x007040, length = 0x000010
   SCI_A      : origin = 0x007050, length = 0x000010
   XINTRUPT   : origin = 0x007070, length = 0x000010
   GPIOMUX    : origin = 0x0070C0, length = 0x000020
   GPIODAT    : origin = 0x0070E0, length = 0x000020
   ADC        : origin = 0x007100, length = 0x000020
   EV_A       : origin = 0x007400, length = 0x000040
   EV_B       : origin = 0x007500, length = 0x000040
   SPI_B      : origin = 0x007740, length = 0x000010
   SCI_B      : origin = 0x007750, length = 0x000010
   MCBSP_A    : origin = 0x007800, length = 0x000040
   /* CSM Password Locations */
   CSM_PWL    : origin = 0x3F7FF8, length = 0x000008
   /* XRAM                    */     
   
   
   DRAMXINTF6A : origin = 0x100000, length = 0x0024FF
   DRAMXINTF6B : origin = 0x102500, length = 0x0024FF
   DRAMXINTF6C : origin = 0x105000, length = 0x0024FF      
   
}
/*------------------------------------------*/
/*描述:设置堆栈值          */
/*------------------------------------------*/
-stack 800
/*------------------------------------------*/
/*描述:通过SECTION伪指令来分配段到存储空间  */
/*------------------------------------------*/
SECTIONS
{
   .reset           : >  RESET,      PAGE = 0, TYPE = DSECT
   vectors   : >  VECTORS,    PAGE = 0, TYPE = DSECT
  
   codestart        : > BEGIN,       PAGE = 0
   wddisable  : > FLASH,      PAGE = 0
   copysections     : > FLASH,   PAGE = 0  /* Used by file SectionCopy.asm */
   .stack           : > RAMM0,       PAGE = 1
   .bss    : > RAMM1,       PAGE = 1
   .ebss            : > RAMM1,       PAGE = 1
   .sysmem   : > RAMM1,       PAGE = 1
   .esysmem         : > RAMM1,       PAGE = 1
   .const   : > RAMM1,   PAGE = 1
   .switch   : > RAMH0,   PAGE = 0
   /*** Initialized Sections ***/                                          
   .cinit   : LOAD = FLASH, PAGE = 0 /* Load section to Flash */
                  RUN = RAMH0,    PAGE = 0    /* Run section from RAM */
                  LOAD_START(_cinit_loadstart),
                  RUN_START(_cinit_runstart),
      SIZE(_cinit_size)

.econst   :   LOAD = FLASH,   PAGE = 0    /* Load section to Flash */
                  RUN = RAMH0,    PAGE = 0    /* Run section from RAM */
                  LOAD_START(_econst_loadstart),
                  RUN_START(_econst_runstart),
      SIZE(_econst_size)
.pinit   :   LOAD = FLASH,   PAGE = 0    /* Load section to Flash */
                  RUN = RAMH0,    PAGE = 0    /* Run section from RAM */
                  LOAD_START(_pinit_loadstart),
                  RUN_START(_pinit_runstart),
      SIZE(_pinit_size)
.text   :   LOAD = FLASH,  PAGE = 0    /* Load section to Flash */
                  RUN = RAML0L1,    PAGE = 0    /* Run section from RAM */
                  LOAD_START(_text_loadstart),
                  RUN_START(_text_runstart),
      SIZE(_text_size)
   
   
   CURRENTA    : > DRAMXINTF6A,    PAGE = 1
   CURRENTB    : > DRAMXINTF6B,    PAGE = 1
   CURRENTC    : > DRAMXINTF6C,    PAGE = 1
   
   /* Allocate IQ math areas: */
   IQmath           : > FLASH,       PAGE = 0                /* Math Code */
   IQmathTables     : > ROM,         PAGE = 0, TYPE = NOLOAD /* Math Tables In ROM */
  
   
   PieVectTableFile : > PIE_VECT,   PAGE = 1
/* Allocate 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      
   PieVectTable     : > PIE_VECT    PAGE = 1
   /* Allocate Peripheral Frame 2 Register Structures:   */
   ECanaRegsFile       : > ECAN_A      PAGE = 1   
   ECanaMboxesFile     : > ECAN_AMBOX  PAGE = 1
   /* Allocate Peripheral Frame 1 Register Structures:   */
   SysCtrlRegsFile     : > SYSTEM      PAGE = 1
   SpiaRegsFile        : > SPI_A       PAGE = 1
   SciaRegsFile        : > SCI_A       PAGE = 1
   XIntruptRegsFile    : > XINTRUPT    PAGE = 1
   GpioMuxRegsFile     : > GPIOMUX     PAGE = 1
   GpioDataRegsFile    : > GPIODAT     PAGE = 1
   AdcRegsFile         : > ADC         PAGE = 1
   EvaRegsFile         : > EV_A        PAGE = 1
   EvbRegsFile         : > EV_B        PAGE = 1
   ScibRegsFile        : > SCI_B       PAGE = 1
   McbspaRegsFile      : > MCBSP_A     PAGE = 1
   /* CSM Password Locations */
   CsmPwlFile          : > CSM_PWL     PAGE = 1
}
.ASM文件;
WD_DISABLE .set 1  ;置1禁止看门狗
    .ref copy_sections
.global codestart

    .sect "codestart"
code_start:
    .if WD_DISABLE == 1
        LB wd_disable       ;跳转至屏蔽看门狗代码
    .else
        LB copy_sections         ;跳转至引导程序_c_int00
    .endif
;end codestart section
;***********************************************************************
;* Function: wd_disable
;* Description: Disables the watchdog timer
;***********************************************************************
    .if WD_DISABLE == 1
    .sect "wddisable"
wd_disable:
    SETC OBJMODE        ;C28x目标模式
    EALLOW              ;允许访问受保护的寄存器
    MOVZ DP, #7029h>>6  ;加载看门狗控制寄存器
    MOV @7029h, #0068h  ;禁止看门狗
    EDIS                ;禁止访问受保护的寄存器
    LB copy_sections         ;跳转至运行库中的boot.asm
    .endif
   .end
;//###########################################################################
  .global _SetDBGIER
  .text
  
_SetDBGIER:
  MOV  *SP++,AL
  POP  DBGIER
  LRETR
   .ref _c_int00
.global copy_sections
.global _cinit_loadstart, _cinit_runstart, _cinit_size
;.global _const_loadstart, _const_runstart, _const_size
.global _econst_loadstart, _econst_runstart, _econst_size
.global _pinit_loadstart, _pinit_runstart, _pinit_size
;.global _switch_loadstart, _switch_runstart, _switch_size
.global _text_loadstart, _text_runstart, _text_size

***********************************************************************
* Function: copy_sections
*
* Description: Copies initialized sections from flash to ram
***********************************************************************
.sect "copysections"
copy_sections:
;MOVL XAR5,#_const_size    ; Store Section Size in XAR5
;MOVL ACC,@XAR5      ; Move Section Size to ACC
;MOVL XAR6,#_const_loadstart   ; Store Load Starting Address in XAR6
    ;MOVL XAR7,#_const_runstart   ; Store Run Address in XAR7
    ;LCR  copy       ; Branch to Copy
   
MOVL XAR5,#_econst_size    ; Store Section Size in XAR5
MOVL ACC,@XAR5      ; Move Section Size to ACC
MOVL XAR6,#_econst_loadstart  ; Store Load Starting Address in XAR6
    MOVL XAR7,#_econst_runstart   ; Store Run Address in XAR7
    LCR  copy       ; Branch to Copy
MOVL XAR5,#_pinit_size    ; Store Section Size in XAR5
MOVL ACC,@XAR5      ; Move Section Size to ACC
MOVL XAR6,#_pinit_loadstart   ; Store Load Starting Address in XAR6
    MOVL XAR7,#_pinit_runstart   ; Store Run Address in XAR7
    LCR  copy       ; Branch to Copy
;MOVL XAR5,#_switch_size    ; Store Section Size in XAR5
;MOVL ACC,@XAR5      ; Move Section Size to ACC
;MOVL XAR6,#_switch_loadstart  ; Store Load Starting Address in XAR6
    ;MOVL XAR7,#_switch_runstart   ; Store Run Address in XAR7
    ;LCR  copy       ; Branch to Copy
MOVL XAR5,#_text_size    ; Store Section Size in XAR5
MOVL ACC,@XAR5      ; Move Section Size to ACC
MOVL XAR6,#_text_loadstart   ; Store Load Starting Address in XAR6
    MOVL XAR7,#_text_runstart   ; Store Run Address in XAR7
    LCR  copy       ; Branch to Copy
   
    MOVL XAR5,#_cinit_size    ; Store Section Size in XAR5
MOVL ACC,@XAR5      ; Move Section Size to ACC
MOVL XAR6,#_cinit_loadstart   ; Store Load Starting Address in XAR6
    MOVL XAR7,#_cinit_runstart   ; Store Run Address in XAR7
    LCR  copy       ; Branch to Copy
    LB _c_int00        ; Branch to start of boot.asm in RTS library
copy:
B return,EQ       ; Return if ACC is Zero (No section to copy)
    RPT AL        ; Copy Section From Load Address to
    || PWRITE  *XAR7, *XAR6++   ; Run Address
return:
LRETR        ; Return
.end

;//===========================================================================
;// End of file.
;//===========================================================================
主函数只有初始化
但是下不到FLASH里面
总报错:data verification failed at address 0x3f7ff6

相关帖子

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

本版积分规则

个人签名:求真,务实

2

主题

98

帖子

0

粉丝