⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 era24_x1.lst

📁 jaaj
💻 LST
📖 第 1 页 / 共 2 页
字号:
C:\DSPTOOLS\FIX_663\DSPA.EXE -a ERA24_X1.ABS -v2xx 

TMS320C1x/C2x/C2xx/C5x COFF Assembler Beta Version 6.63  Tue Nov 30 13:52:44 1999
Copyright (c) 1987-1996  Texas Instruments Incorporated 
ERA24_X1.ABS                                                         PAGE    1

      47 3800                 .text
      48                      .copy       "ERA24_X1.ASM"
 A     1            *************************************************************
 A     2            * ERASE subroutine                                         **
 A     3            *                                                          **
 A     4            * TMS320F2XX Flash Utilities.                              **
 A     5            * Revision: 2.0, 9/10/97                                   **
 A     6            *                                                          **
 A     7            * Filename: ERA24_X1.ASM                                   **
 A     8            * Changes: Re-written to include latest flash algorithms.  **
 A     9            *                                                          **
 A    10            *                DSP Applications                          **
 A    11            *                Texas Instruments Inc.                    **
 A    12            *                                                          **
 A    13            * Called by : c2xx_bex.asm or flash application programs.  **
 A    14            *                                                          **
 A    15            * !!CAUTION - INITIALIZE DP BEFORE CALLING THIS ROUTINE!!  **
 A    16            *                                                          **
 A    17            * Function  : Erases one or more contiguos segments of     **
 A    18            *             flash array 0/1 as specified by the          **
 A    19            *             following variables.                         **
 A    20            *             SEG_ST = Segment start address.              **
 A    21            *             SEG_END= Segment end address.                **
 A    22            *             PROTECT= Sector protect enable.              **
 A    23            *                                                           *
 A    24            * The algorithm used is "XOR-VER1" which means that in      *
 A    25            * addition to the VER1 readmode, an XOR readback is used to *
 A    26            * gain more margin. During the read portion of the erase to *
 A    27            * reads are performed for each address; for the first read  *
 A    28            * all address bits are complemented using a logical XOR with*
 A    29            * the array end address. The data read during the first read*
 A    30            * is discarded and the second read is performed on the      *
 A    31            * actual address. This scheme simulates the worst-case      *
 A    32            * branching condition for code executing from the flash     *
 A    33            * array.                                                    *
 A    34            * The erase pulse-width is 7ms, and a maximum of 1000 pulses*
 A    35            * are applied to the array.                                 *
 A    36            *                                                           *
 A    37            * The following resources are used for temporary storage:   *
 A    38            *        AR0  - Used for comparisons.                       *
 A    39            *        AR1  - Used for erase pulse count.                 *
 A    40            *        AR2  - Used for main banz loop.                    *
 A    41            *        AR6  - Parameter passsed to DELAY.                 *
 A    42            *        B2_0 - Parameter passed to Set_mode.               *
 A    43            *        B2_1 - Used for flash address.                     *
 A    44            *        B2_2 - Used for flash data.                        *
 A    45            *        B2_3 - Used for flash checksum.                    *
 A    46            *        B2_4 - Used for segment size.                      *
 A    47            *        B2_5 -                                             *
 A    48            *        B2_6 -                                             *
 A    49            *************************************************************
 A    50                    .include "svar2x.h" ;defines variables for flash0
 A    51            *
 A    52      03e8  MAX_ER  .set    1000       ;Only allow 1000 erase pulses.
TMS320C1x/C2x/C2xx/C5x COFF Assembler Beta Version 6.63  Tue Nov 30 13:52:44 1999
Copyright (c) 1987-1996  Texas Instruments Incorporated 
ERA24_X1.ABS                                                         PAGE    2

 A    53      0008  VER1    .set    8          ;VER1 command.
 A    54      0002  ER_CMND .set    2          ;ERASE COMMAND WORD
 A    55      0043  ER_EXE  .set    043h       ;ERASE EXEBIN COMMAND WORD
 A    56      0018  INV_ER  .set    018h       ;INVERSE ERASE COMMAND WORD
 A    57      0006  FL_WR   .set    6          ;FLASH WRITE COMMAND WORD
 A    58      0047  FLWR_EX .set    047h       ;FLASH WRITE EXEBIN COMMAND WORD
 A    59      0000  STOP    .set    0          ;RESET REGISTER COMMAND WORD
 A    60            
 A    61                    .def    ERASE
 A    62            ;       .ref    PROTECT, SEG_ST,SEG_END
 A    63            ;       .ref    DELAY,REGS,ARRAY
 A    64            
 A    65            ************************************************************
 A    66            * Code initialization section                              *
 A    67            * Initialize test loop counters:                           *
 A    68            *   AR1 is the number of ERASE pulses.                     *
 A    69            ************************************************************
 A    70 fe66              .sect    ".alg"
 A    71            
 A    72            ;GERS:   SPLK    #0,IMR          ;MASK ALL INTERRUPTS
 A    73            ;       SETC    INTM            ;GLOBAL MASK OF INTERRUPTS
 A    74            
 A    75 fe66 691a! ERASE:  LACL    SEG_ST          ;Get segment start address.
 A    76 fe67 bfb0          AND     #04000h         ;Get array start address.
         fe68 4000  
 A    77 fe69 9021!         SACL    FL_ST           ;Save array start address.
 A    78 fe6a bfc0          OR      #03FFFh         ;Get array end address.
         fe6b 3fff  
 A    79 fe6c 9022!         SACL    FL_END          ;Save array end address.
 A    80            
 A    81 fe6d ae1f!         SPLK    #0,ERROR        ;Reset error flag
         fe6e 0000  
 A    82 fe6f b100          LAR     AR1,#0          ;SET ERASE COUNT = 0
 A    83 fe70       FIRST_SEG
 A    84 fe70 7a80          CALL    XOR_ERASE       ;ERASE FLASH SEGMENT
         fe71 fe7c+ 
 A    85 fe72 7a80          CALL    INV_ERASE       ;Check for depletion.
         fe73 feb7+ 
 A    86 fe74       NEXT_SEG
 A    87 fe74 ef00          RET                     ;Return to calling code.
 A    88            
 A    89            * If here, then an error has occured.
 A    90 fe75 ae1f! EXIT    SPLK    #1,ERROR                ;Update error flag
         fe76 0001  
 A    91 fe77 7a80          CALL    CLR_CMND                ;Disable any flash cmds.
         fe78 fee8+ 
 A    92            
 A    93            ;       IN      DUMMY, F24X_ACCS        ;(DAF)
 A    94 fe79 7a80          CALL    ARRAY                   ;ACCESS FLASH ARRAY
         fe7a fef4+ 
 A    95 fe7b ef00          RET
 A    96            ;       B       NEXT_SEG                ;Get outa here.
 A    97            
 A    98            
TMS320C1x/C2x/C2xx/C5x COFF Assembler Beta Version 6.63  Tue Nov 30 13:52:44 1999
Copyright (c) 1987-1996  Texas Instruments Incorporated 
ERA24_X1.ABS                                                         PAGE    3

 A    99            ;       .page
 A   100            ************************************************
 A   101            * XOR_ERASE: This routine performs an erase to *
 A   102            * xorver1 level. The Seg to erase is defined by*
 A   103            * the vars SEG_ST and SEG_END. The following   *
 A   104            * resources are used for temporary storage:    *
 A   105            *        AR0  - Used for comparisons.          *
 A   106            *        AR1  - Used for erase pulse count.    *
 A   107            *        AR2  - Used for main banz loop.       *
 A   108            *        B2_0 - Parameter passed to Set_mode.  *
 A   109            *        B2_1 - Used for flash address.        *
 A   110            *        B2_2 - Used for flash data.           *
 A   111            *        B2_3 - Used for flash checksum.       *
 A   112            *        B2_4 - Used for segment size.         *
 A   113            ************************************************
 A   114 fe7c       XOR_ERASE
 A   115            * COMPUTE CHKSUM ON FLASH1 TO SEE IF ERASED
 A   116 fe7c 7a80          CALL    CLR_CMND                ;Disable any flash cmds.
         fe7d fee8+ 
 A   117 fe7e ae0d!         SPLK    #VER1,B2_0
         fe7f 0008  
 A   118 fe80 7a80          CALL    SET_MODE                ;Set VER1 mode.
         fe81 feae+ 
 A   119 fe82 be47          SETC    SXM                     ;Enable sign extension.                     
 A   120 fe83 be42          CLRC    OVM                     ;Disable overflow mode.
 A   121 fe84 101b!         LACC    SEG_END
 A   122 fe85 301a!         SUB     SEG_ST
 A   123 fe86 9011!         SACL    B2_4                    ;Segment length-1.
 A   124 fe87 0211!         LAR     AR2,B2_4                ;load n-1 to loop n times.
 A   125 fe88 b801          ADD     #1
 A   126 fe89 9011!         SACL    B2_4                    ;Segment length.
 A   127 fe8a 8b8a          MAR     *,AR2
 A   128 fe8b a80e!         BLDD    #SEG_ST,B2_1            ;Segment start address.
         fe8c 031a! 
 A   129 fe8d ae10!         SPLK    #0,B2_3                 ;Clear checksum.
         fe8e 0000  
 A   130 fe8f       RD1_LOOP                                ;For I = SEG_ST to SEG_END.
 A   131 fe8f 100e!         LACC    B2_1                    ;ACC => CURRENT ADDR.
 A   132 fe90 6c22!         XOR     FL_END                  ;XOR addr with flash end addr.
 A   133 fe91 a60f!         TBLR    B2_2                    ;Dummy Read.
 A   134 fe92 100e!         LACC    B2_1                    ;Get actual addr again.
 A   135 fe93 a60f!         TBLR    B2_2                    ;True Read.
 A   136 fe94 b801          ADD     #1                      ;Increment flash addr.
 A   137 fe95 900e!         SACL    B2_1                    ;Store for next read.
 A   138 fe96 1010!         LACC    B2_3                    ;Get old check sum.
 A   139 fe97 200f!         ADD     B2_2                    ;ACC=>ACC+FL_DATA.
 A   140 fe98 9010!         SACL    B2_3                    ;Save new check sum.
 A   141 fe99 7b90          BANZ    RD1_LOOP,*-
         fe9a fe8f+ 
 A   142 fe9b 2011!         ADD     B2_4                    ;Should make ACC=0 for erased array.
 A   143 fe9c e388          BCND    XOR_ERFIN,EQ            ;If B2_3=0 finished.
         fe9d fea4+ 
 A   144                            
 A   145            * IF NOT ERASED, PERFORM A FLASH ERASE
TMS320C1x/C2x/C2xx/C5x COFF Assembler Beta Version 6.63  Tue Nov 30 13:52:44 1999
Copyright (c) 1987-1996  Texas Instruments Incorporated 
ERA24_X1.ABS                                                         PAGE    4

 A   146 fe9e 7a80          CALL    ERASE_A                 ;Else, pulse it again.
         fe9f fecd+ 
 A   147 fea0 7a89          CALL    INC_ERASE,AR1           ;Inc erase pulse count(AR1).

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -