This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28075: HWBIST测试导致异常中断

Part Number: TMS320F28075
Other Parts Discussed in Thread: C2000WARE

你好,TI 的技术专家,

      我用C:\ti\c2000\C2000Ware_1_00_01_00\libraries\diagnostic里的自检测试程序在TMS320F28075中运行HWBIST检测,出现异常中断的情况,程序无法执行。

     如图所示:

    cmd文件内容:        
//
// Ensure STL_HWBIST_restoreContext() is linked properly.
//
-u _STL_HWBIST_restoreContext

MEMORY
{
PAGE 0 :  /* Program Memory */
          /* Memory (RAM/FLASH) blocks can be moved to PAGE1 for data allocation */
          /* BEGIN is used for the "boot to Flash" bootloader mode   */
   HWBIST           : origin = 0x000000, length = 0x000020
   BEGIN               : origin = 0x080000, length = 0x000002
   RAMM0               : origin = 0x000122, length = 0x0002DE
   RAMD0               : origin = 0x00B000, length = 0x000800
 /*  RAMLS0              : origin = 0x008000, length = 0x000800
   RAMLS1              : origin = 0x008800, length = 0x000800
   RAMLS2              : origin = 0x009000, length = 0x000800
   RAMLS3              : origin = 0x009800, length = 0x000800*/
   RAMLS0_3         : origin = 0x008000, length = 0x002000
   RAMLS4              : origin = 0x00A000, length = 0x000800
   RESET               : origin = 0x3FFFC0, length = 0x000002
   
   /* Flash sectors */
   FLASHA           : origin = 0x080002, length = 0x001FFE    /* on-chip Flash */
   FLASHB           : origin = 0x082000, length = 0x002000    /* on-chip Flash */
   FLASHC           : origin = 0x084000, length = 0x002000    /* on-chip Flash */
   FLASHD           : origin = 0x086000, length = 0x002000    /* on-chip Flash */
   FLASHE           : origin = 0x088000, length = 0x008000    /* on-chip Flash */
   FLASHF           : origin = 0x090000, length = 0x008000    /* on-chip Flash */
   FLASHG           : origin = 0x098000, length = 0x008000    /* on-chip Flash */
   FLASHH           : origin = 0x0A0000, length = 0x008000    /* on-chip Flash */
   FLASHI           : origin = 0x0A8000, length = 0x008000    /* on-chip Flash */
   FLASHJ           : origin = 0x0B0000, length = 0x008000    /* on-chip Flash */
   FLASHK           : origin = 0x0B8000, length = 0x002000    /* on-chip Flash */
   FLASHL           : origin = 0x0BA000, length = 0x002000    /* on-chip Flash */
   FLASHM           : origin = 0x0BC000, length = 0x002000    /* on-chip Flash */
   FLASHN           : origin = 0x0BE000, length = 0x002000    /* on-chip Flash */

PAGE 1 : /* Data Memory */
         /* Memory (RAM/FLASH) blocks can be moved to PAGE0 for program allocation */

   BOOT_RSVD       : origin = 0x000002, length = 0x000120     /* Part of M0, BOOT rom will use this for stack */
   RAMM1           : origin = 0x000400, length = 0x000400     /* on-chip RAM block M1 */
   RAMD1           : origin = 0x00B800, length = 0x000800
   RAMLS3          : origin = 0x009800, length = 0x000800
   RAMLS5      : origin = 0x00A800, length = 0x000800

   RAMGS0      : origin = 0x00C000, length = 0x001000
   RAMGS1      : origin = 0x00D000, length = 0x001000
   RAMGS2      : origin = 0x00E000, length = 0x001000
   RAMGS3      : origin = 0x00F000, length = 0x001000
   RAMGS4      : origin = 0x010000, length = 0x001000
   RAMGS5      : origin = 0x011000, length = 0x001000
   RAMGS6      : origin = 0x012000, length = 0x001000
   RAMGS7      : origin = 0x013000, length = 0x001000
}


SECTIONS
{
   /* Allocate program areas: */
   .cinit              : > FLASHB      PAGE = 0, ALIGN(4)
   .pinit              : > FLASHB,     PAGE = 0, ALIGN(4)
   .text               : >> FLASHB | FLASHC | FLASHD | FLASHE      PAGE = 0, ALIGN(4)
   codestart           : > BEGIN       PAGE = 0, ALIGN(4)
      /* Must be placed at 0x0000 */
   hwbist           : LOAD = FLASHJ,
                      RUN = HWBIST,
                      LOAD_START(_HwbistLoadStart),
                      LOAD_SIZE(_HwbistLoadSize),
                      LOAD_END(_HwbistLoadEnd),
                      RUN_START(_HwbistRunStart),
                      RUN_SIZE(_HwbistRunSize),
                      RUN_END(_HwbistRunEnd),
                      PAGE = 0, ALIGN(4)
   /* Must be placed lower than a 16-bit memory address */
   hwbiststack      : > RAMD0,       PAGE = 0

#ifdef __TI_COMPILER_VERSION__
   #if __TI_COMPILER_VERSION__ >= 15009000
 /*  GROUP
           {
        .TI.ramfunc : {

                        }
        }LOAD = FLASHD,
                         RUN = RAMLS0 | RAMLS1 | RAMLS2 |RAMLS3,
                         LOAD_START(_RamfuncsLoadStart),
                         LOAD_SIZE(_RamfuncsLoadSize),
                         LOAD_END(_RamfuncsLoadEnd),
                         RUN_START(_RamfuncsRunStart),
                         RUN_SIZE(_RamfuncsRunSize),
                         RUN_END(_RamfuncsRunEnd),
                         PAGE = 0, ALIGN(4)
*/

         GROUP
           {
              .TI.ramfunc:
              {
//                   F021_API_F2837xD_FPU32.lib
//                   rts2800_fpu32.lib <*> (.text)
              }
           } LOAD = FLASHD,
           RUN =  RAMLS0_3 ,
           LOAD_START(_RamfuncsLoadStart),
           LOAD_SIZE(_RamfuncsLoadSize),
           LOAD_END(_RamfuncsLoadEnd),
           RUN_START(_RamfuncsRunStart),
           RUN_SIZE(_RamfuncsRunSize),
           RUN_END(_RamfuncsRunEnd),
           PAGE = 0, ALIGN(4)

   #else
   ramfuncs            : LOAD = FLASHD,
                         RUN = RAMLS0_4, /*RAMLS0 | RAMLS1 | RAMLS2 |RAMLS3,*/
                         LOAD_START(_RamfuncsLoadStart),
                         LOAD_SIZE(_RamfuncsLoadSize),
                         LOAD_END(_RamfuncsLoadEnd),
                         RUN_START(_RamfuncsRunStart),
                         RUN_SIZE(_RamfuncsRunSize),
                         RUN_END(_RamfuncsRunEnd),
                         PAGE = 0, ALIGN(4)   
   #endif
#endif


                        
   /* Allocate uninitalized data sections: */
   .stack              : > RAMM1        PAGE = 1
   .ebss               : >> RAMLS5 | RAMGS0 | RAMGS1       PAGE = 1
   .esysmem            : > RAMLS5       PAGE = 1

   /* Initalized sections go in Flash */
   .econst             : >> FLASHF | FLASHG       PAGE = 0, ALIGN(4)
   .switch             : > FLASHB      PAGE = 0, ALIGN(4)
   
   .reset              : > RESET,     PAGE = 0, TYPE = DSECT /* not used, */


   /* the software version of ARM */
   BufferDataSection1  : > RAMGS7,    PAGE = 1
   /* Sections for STL_RAM tests */
   d1ram            : > RAMD1,      PAGE = 1
   ls3ram           : > RAMLS3,     PAGE = 1
}

/*
//===========================================================================
// End of file.
//===========================================================================
*/
HWBIST部分的代码:

                //*******************************************
    //HWBIST  (hardware build-in self test)
    //
    UINT32 previousNMIVector = HWREG(PIEVECTTABLE_BASE +
                                       PIEVECTTABLE_O_NMI);

    STL_Util_clearErrorFlag(STL_UTIL_HWBIST_NMI_TEST);
    STL_Util_clearErrorFlag(STL_UTIL_HWBIST_FAIL);
    STL_Util_clearErrorFlag(STL_UTIL_HWBIST_NMI_INT);
    STL_Util_clearErrorFlag(STL_UTIL_HWBIST_OVERRUN);

    STL_HWBIST_Error error = STL_HWBIST_NO_ERROR;
    //
    // Inject an error.
    //
    UINT16 STA_Tests_hwbistCounterFull = 0;
    switch(STA_Tests_hwbistCounterFull % 5)
    {
        case 0:
        {
            //
            // TID_01_35_01
            //
            error = STL_HWBIST_NO_ERROR; // 0x0003
            break;
        }
        case 1:
        {
            //
            // TID_01_36_01
            //
            error = STL_HWBIST_TIMEOUT; // 0x0029
            break;
        }
        case 2:
        {
            //
            // TID_01_37_01
            //
            error = STL_HWBIST_FINAL_COMPARE; //0x0003
            break;
        }
        case 3:
        {
            //
            // TID_01_38_01
            //
            error = STL_HWBIST_NMI_TRAP; //0x0005
            break;
        }
        case 4:
        {
            //
            // TID_01_39_01
            //
            error = STL_HWBIST_LOGIC_FAULT; //0x001B
            break;
        }
    }
    //
    // Run the full HWBIST test until complete.
    //
//    error = STL_HWBIST_LOGIC_FAULT;
    HWBIST_returnVal = STL_HWBIST_runFull(error);

自检库中的c文件和asm文件都没有改动过。