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.

TMDX570LS31HDK - ESM Group 3, Channel 7, unrecoverable error in Flash wrapper (FMC)

Other Parts Discussed in Thread: TMS570LS3137

Hello

In short: 

If I flash a application (size 0xE110 bytes) then the HDK board does not start and 

Flash Check fails.

If I flash small application (attached) then sometimes the boards recovers and
starts without error - in other words it is not a persistent problem.

I do not know the details of the HDK board and BSP.
It seems the application influences the result of hardware checks. This is unexpected.

I do not know how to workaround/fix it.

Martin

Detailed version:
I have

* Code Composer Studio Version: 6.1.2.00014
* TMDX570LS31HDK (= TMS570LS3137)
* HAL Code Generator 04.05.01

HDK worked for a long time.

Now we flashed application and then the debugger could not connect anymore.
We fixed this problem by using Warm Reset (button S3 nRST) during flash and
now we can flash again without problems, but the board does not start anymore.

We traced the problem to sys_startup.c :
/* Check if there were ESM group3 errors during power-up.
* These could occur during eFuse auto-load or during reads from flash OTP
* during power-up. Device operation is not reliable and not recommended
* in this case.
* An ESM group3 error only drives the nERROR pin low. An external circuit
* that monitors the nERROR pin must take the appropriate action to ensure that
* the system is placed in a safe state, as determined by the application.
*/
if ((esmREG->SR1[2]) != 0U)
{
/* USER CODE BEGIN (24) */
/* USER CODE END */
/*SAFETYMCUSW 5 C MR:NA <APPROVED> "for(;;) can be removed by adding "# if 0" and "# endif" in the user codes above and below" */
/*SAFETYMCUSW 26 S MR:NA <APPROVED> "for(;;) can be removed by adding "# if 0" and "# endif" in the user codes above and below" */
/*SAFETYMCUSW 28 D MR:NA <APPROVED> "for(;;) can be removed by adding "# if 0" and "# endif" in the user codes above and below" */
for(;;)
{
}/* Wait */

Memory View : esmREG at 0xFFFFF500
The value of registers:
Esm_Stat1 = 0x0000_0000
Esm_Stat2 = 0x0000_0000
Esm_Stat3 = 0x0000_0080
=> This means ESM Group 3, Channel 7, unrecoverable error in Flash wrapper (FMC).

FMCFEDACSTATUS =(0XFFF8701C) = 0x0001_0100

=> This means :
bit 16: B2_COR_ERR Bus 2 Correctable Error
bit 8: B1_UNC_ERR Bus 1 Uncorrectable Error Flag - register FUNC_ERR_ADD contains error location.

FUNC_ERR_ADD =(0XFFF87020) = 0x0003_D298

If I look with memory viewer at 0x0003_D298 then it shows all bits set (0xFFFF_FFFF).

We have a second HDK board flash a large application triggers the fault :
Esm_Stat1 = 0x0000_0400
Esm_Stat2 = 0x0000_0000
Esm_Stat3 = 0x0000_0080
FMCFEDACSTATUS =(0XFFF8701C) = 0x0000_0100
FUNC_ERR_ADD =(0XFFF87020) = 0x0003_D250

MEMORY CONFIGURATION :

name origin length used unused attr fill
---------------------- -------- --------- -------- -------- ---- --------
VECTORS 00000000 00000020 00000020 00000000 X
FLASH0 00000020 0017ffe0 0000e110 00171ed0 R X
FLASH1 00180000 00180000 00000000 00180000 R X
STACKS 08000000 00001500 00000000 00001500 RW
RAM 08001500 0003eb00 00000e9e 0003dc62 RW

=> 0x3D250 vs 0x3D298 = same area of the flash. The size of the app is smaller (0xE110 used)

 

 



 


 

 

4861.TEST.zip

 

 

 

 

 

 

  • Martin,
    Have you programmed the Flash ECC?

    Best Regards,
    Kevin Lavery
  • Hello,

    Thanks for the fast answer.

    I have used default settings. I did not turn on/off something on purpose -
    Maybe by accident during investigation - I do not know.
    How can I double check if I have programmed Flash ECC ?

    New Input:
    It seems power cycle HDK Board (disconnect USB and external Power supply) changes
    the behavior. In other words before power cycle the check fails (Esm_Stat3 != 0) and after
    power cycle the check is ok ((Esm_Stat3 == 0).

    BR
    Martin
  • Martin,
    I do not know what state the device is in at the end of programming.
    If the code always works after it has been power-cycled, do you still have a problem?

    Best Regards,
    Kevin Lavery
  • After end of programming Code Composer switch to Debug Perspective.

    It seems the code below is executed and then the CPU hangs in for (;;). 

    Resume and Go is deactivated (grey). The user can press Terminate to exit Debug mode.

    Power cycle changes something. I did not expected changes of flash with/without

    powercycle. I do not remember , but I  think somewhere that errors can be read

    and/or cleared. Maybe this happens with power cycle ?

    If I do not power cycle and just press Terminate and Debug (Program again) then the 

    error exists. 

    After  power cycle I loose the current debug session. Therefore it is not a workaround. 

    void _c_int00(void)
    {

    /* USER CODE BEGIN (5) */
    /* USER CODE END */

    /* Initialize Core Registers to avoid CCM Error */
    _coreInitRegisters_();

    /* USER CODE BEGIN (6) */
    /* USER CODE END */

    /* Initialize Stack Pointers */
    _coreInitStackPointer_();

    /* USER CODE BEGIN (7) */
    /* USER CODE END */

    /* Work Around for Errata DEVICE#140: ( Only on Rev A silicon)
    *
    * Errata Description:
    * The Core Compare Module(CCM-R4) may cause nERROR to be asserted after a cold power-on
    * Workaround:
    * Clear ESM Group2 Channel 2 error in ESMSR2 and Compare error in CCMSR register */
    if (DEVICE_ID_REV == 0x802AAD05U)
    {
    _esmCcmErrorsClear_();
    }

    /* USER CODE BEGIN (8) */
    /* USER CODE END */

    /* Enable CPU Event Export */
    /* This allows the CPU to signal any single-bit or double-bit errors detected
    * by its ECC logic for accesses to program flash or data RAM.
    */
    _coreEnableEventBusExport_();

    /* USER CODE BEGIN (11) */
    /* USER CODE END */

    /* Workaround for Errata CORTEXR4 66 */
    _errata_CORTEXR4_66_();

    /* Workaround for Errata CORTEXR4 57 */
    _errata_CORTEXR4_57_();

    /* Reset handler: the following instructions read from the system exception status register
    * to identify the cause of the CPU reset.
    */

    /* check for power-on reset condition */
    /*SAFETYMCUSW 139 S MR:13.7 <APPROVED> "Hardware status bit read check" */
    if ((SYS_EXCEPTION & POWERON_RESET) != 0U)
    {
    /* USER CODE BEGIN (12) */
    /* USER CODE END */

    /* clear all reset status flags */
    SYS_EXCEPTION = 0xFFFFU;

    /* USER CODE BEGIN (13) */
    /* USER CODE END */
    /* USER CODE BEGIN (14) */
    /* USER CODE END */
    /* USER CODE BEGIN (15) */
    /* USER CODE END */
    /* continue with normal start-up sequence */
    }
    /*SAFETYMCUSW 139 S MR:13.7 <APPROVED> "Hardware status bit read check" */
    else if ((SYS_EXCEPTION & OSC_FAILURE_RESET) != 0U)
    {
    /* Reset caused due to oscillator failure.
    Add user code here to handle oscillator failure */

    /* USER CODE BEGIN (16) */
    /* USER CODE END */
    }
    /*SAFETYMCUSW 139 S MR:13.7 <APPROVED> "Hardware status bit read check" */
    else if ((SYS_EXCEPTION & WATCHDOG_RESET) !=0U)
    {
    /* Reset caused due
    * 1) windowed watchdog violation - Add user code here to handle watchdog violation.
    * 2) ICEPICK Reset - After loading code via CCS / System Reset through CCS
    */
    /* Check the WatchDog Status register */
    if(WATCHDOG_STATUS != 0U)
    {
    /* Add user code here to handle watchdog violation. */
    /* USER CODE BEGIN (17) */
    /* USER CODE END */

    /* Clear the Watchdog reset flag in Exception Status register */
    SYS_EXCEPTION = WATCHDOG_RESET;

    /* USER CODE BEGIN (18) */
    /* USER CODE END */
    }
    else
    {
    /* Clear the ICEPICK reset flag in Exception Status register */
    SYS_EXCEPTION = ICEPICK_RESET;
    /* USER CODE BEGIN (19) */
    /* USER CODE END */
    }
    }
    /*SAFETYMCUSW 139 S MR:13.7 <APPROVED> "Hardware status bit read check" */
    else if ((SYS_EXCEPTION & CPU_RESET) !=0U)
    {
    /* Reset caused due to CPU reset.
    CPU reset can be caused by CPU self-test completion, or
    by toggling the "CPU RESET" bit of the CPU Reset Control Register. */

    /* USER CODE BEGIN (20) */
    /* USER CODE END */

    /* clear all reset status flags */
    SYS_EXCEPTION = CPU_RESET;

    /* USER CODE BEGIN (21) */
    /* USER CODE END */

    }
    /*SAFETYMCUSW 139 S MR:13.7 <APPROVED> "Hardware status bit read check" */
    else if ((SYS_EXCEPTION & SW_RESET) != 0U)
    {
    /* Reset caused due to software reset.
    Add user code to handle software reset. */

    /* USER CODE BEGIN (22) */
    /* USER CODE END */
    }
    else
    {
    /* Reset caused by nRST being driven low externally.
    Add user code to handle external reset. */

    /* USER CODE BEGIN (23) */
    /* USER CODE END */
    }

    /* Check if there were ESM group3 errors during power-up.
    * These could occur during eFuse auto-load or during reads from flash OTP
    * during power-up. Device operation is not reliable and not recommended
    * in this case.
    * An ESM group3 error only drives the nERROR pin low. An external circuit
    * that monitors the nERROR pin must take the appropriate action to ensure that
    * the system is placed in a safe state, as determined by the application.
    */
    if ((esmREG->SR1[2]) != 0U)
    {
    /* USER CODE BEGIN (24) */
    /* USER CODE END */
    /*SAFETYMCUSW 5 C MR:NA <APPROVED> "for(;;) can be removed by adding "# if 0" and "# endif" in the user codes above and below" */
    /*SAFETYMCUSW 26 S MR:NA <APPROVED> "for(;;) can be removed by adding "# if 0" and "# endif" in the user codes above and below" */
    /*SAFETYMCUSW 28 D MR:NA <APPROVED> "for(;;) can be removed by adding "# if 0" and "# endif" in the user codes above and below" */
    for(;;)
    {
    }/* Wait */

  • Martin,
    When you have finished programming, could you execute a system reset? (Run->Reset->System Reset)
    Do you still see problems?
    Kevin
  • I cannot press reset (see screenshot below). 

    I found a Workaround: 

    I disable all Self tests in

    HAL Code Generator - 

    Tab TMDX570LS3137HDK

    Tab SAFETY INIT

    It seems then nothing is checked and the HDK board starts and executes application. 

    Turn off hardware checks is not a general solution/workaround but acceptable for my current project.

  • Martin,
    As you said, disabling checks is not advised in general.
    In your screenshot, it looks like you may not be connected.
    Best Regards,
    Kevin Lavery