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.

TMS570LS3137: Flash ECC uncorrectable error reported only once

Part Number: TMS570LS3137

Hello,

I am using a TMS570LS3137 processor. I have enabled flash ECC protection doing the following:

  • Enable Flash ECC error detection (FEDACCTRL1.EDACEN = 0xA)
  • Enable core event bus export (calling coreEnableEventBusExport assembly function)
  • Enable flash ECC checking (calling coreEnableFlashEcc assembly function).

In my bootloader which resides at the beginning of the flash, I need to read a location in flash where my application is written to determine if an application is programmed or not. If not application software is programmed, when I read a flash location that was not written, an ECC group3 error occurs but the nError pin is not wired on my board so the DSP doesn't reset and a data abort exception (0x10) is generated. I put an interrupt function on the data abort exception and I want to clear the error and continue execution.

The first time I read the unprogrammed flash address a data abort is generated and the error is also detected as an ECC error. Register ESMSR3 is 0x80 because a FMC - uncorrectable error occurred and Register FEDACSTATUS is 0x100 because a bus1 uncorrectable error occurred. This is good.

Then I clear the error by doing the following:

  • Clear all flash error reported by writing FEDACSTATUS = 0x00FFFFFF
  • Clear all group3 ESM error by writing ESMSR3 = 0xFFFFFFFF
  • Deactivate the error pin by writing ESMEKR bits EKEY = 5

Then I return from the abort exception and the code resumes execution correctly.

My problem is when I read again an unprogrammed flash address a data abort exception is generated but this time it seems the error is not detected by the ECC mechanism because ESMSR3 is 0 and FEDACSTATUS is also 0.

Is there something else I need to clear/reset to allow the ECC mecanism to detect another error?

Thanks,

Martin

  • Hello Martin,

    The error should be repeatable. Did you clear other registers unintendedly? This is my test code, and can reproduce the error in the for(..) loop every time.

    int main(void)

    {

    /* USER CODE BEGIN (3) */

       unsigned int i;

       /* Enable response to ECC errors indicated by CPU for accesses to flash */

       flashWREG->FEDACCTRL1 = 0x000A060AU;

       /* Enable CPU ECC checking for ATCM (flash accesses) */

       _coreEnableFlashEcc_();

       for (i=0; i<100; i++)

         value = *(unsigned int *)(0x20000 + i);

       value = *(unsigned int *)(0x300008);

       /* USER CODE END */

       return 0;

    }

  • Hello,

    Could you share a working example so I can run it on my own?

    Thanks,

    Martin
  • Hello Martin,

    Sure, I will clean up my project and post it later. Thanks
  • Hello Wang,

    I modified your example project to reflect my problem.

    In dabort.asm, I commented the part that branches to flashAbortReal because even if the error is a real 2bit error, I want to clear it and resume execution.

    In sys_main.c, I read at address 0x6000 and 0x6001 which are after the program and are not written by the emulator. This allows me to not erase all the flash.

    So if you execute this program with a break point on the read at address 0x6000 you can see when address 0x6000 is read an abort exception is generated and if you watch register esmsr3 (0xFFFFF520) you can see the value is 0x80 (uncorrectable ECC error). Then the abort code is executed,  it goes in the flashErrorFound part and clears the error. When the code returns from the abort exception register esmsr3 is 0. Then the code reads at address 0x6001. Another abort exception is generated but this time register esmsr3 is 0 instead of 0x80 and the abort code doesn't go into the flashErrorFound part.

    My problem is that the second time an error occurs the ESM module doesn't report it. There might be something else that needs to be cleared.

    Not sure I included the file correctly. Let me know if my modified project is not included.

    Thanks,

    Martin

    3034.TMS570LS3137ZWT_HDK_ECC.7z

  • Hello Wang,

    Did you have time to take a look at my example?

    Regards,

    Martin

  • Hello Wang,

    I finally found my problem.

    First, when reading a location in flash with 1bit error, the error was always corrected but the event was flagged in the ESM and flash registers only the first time. I solved this by reading different locations. Apparently when you read several times in the same faulty 64bits the error is corrected but flagged only the first time.

    Second, when reading a location in flash with 2bit error, an abort exception is generated every time but the event was flagged in the ESM and flash registers only the first time. I solved by reading FUNC_ERR_ADD in the flash registers and clearing the ESM status and flash status registers. Register FUNC_ERR_ADD needs to be read to clear the even and allow another error to be flagged.

    Thanks for your help.

    Martin