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: Not able to generate single bit Flash ECC error

Part Number: TMS570LS3137
Other Parts Discussed in Thread: TMS570LC4357, , NOWECC, HALCOGEN

Hi Team,

We are using sys_selftest.c file by calling checkFlashECC function for generating single bit ECC error in flash.

But, instead of generating correctable ECC error (ESM channel 6), getting uncorrectable ECC error.

The FEDACSTATUS value is always 0x100.

Please let us know is it not possible to get single bit ECC errors for Flash?


Regards,
M.Sreenivasan.

  • Hello,

    Deliberate single bit and double bit errors have been placed in the OTP for checking the FMC ECC

    functionality. Any portion of the 64 bits in TI OTP bank 0 location F008 03F0h through F008 03F7h as

    shown in Figure 5-6 will generate a single bit error. Any portion of the 64 bits in TI OTP bank 0 location F008 03F8h through F008 03FFh as shown in Figure 5-6 will generate a double bit error.

    The fmcECCcheck() function in sys_selftest.c is to generate 1-bit and 2-bit ECC error. The ESM status register SR[0] and SR[2] will be set for 1-bit and 2-bit error.

    The value of FEDACSTATUS is 0x00020100 for 2-bit ECC error, and 0x00010002 for 1 bit error. This is my test:

  • Thanks Wang, with the mentioned address we are able to generate single bit errors.
    So, not all complete Flash is able to generate single bit errors if single bit corruption occurred. It depends on specific addresses that will trigger single and multi bit exceptions. Please confirm.
    Also, is this is documented in the Technical reference, if so can you please share details?

    Regards,
    M.Sreenivasan.
  • Hello,

    If the CPU Event Export is enabled, any single-bit and double-bit error will be detected and reported to ESM.

    _coreEnableEventBusExport_();  --> should be called in sys_startup.c

    The features of "Deliberate single bit and double bit errors" is described on page 342 of spnu563.pdf (TMS570LC4357 TRM). This feature is not in TMS570LS3137 TRM, but all the Hercules devices have this feature (developed in the OTP).

    You can program several words to flash using Flash API, but don't program the ECC. Reading those words will cause ECC error:

    Example code:

    void main(void)

    {

       uint32_t fnRetValue;

    /*do other test*/

       uint32_t ll, i, val1, val2;

       char buf[32];

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

           buf[i] = i;

       ll = Fapi_BlockErase(1, 0x00300000, 0x20000);

       ll = Fapi_BlockProgram( 1, 0x00300000, (unsigned long)buf, 32);  //only program data 

       val1 = *(unsigned int *)(0x00300000);    //cause ECC error

       val1 = *(unsigned int *)(0x00300004);

     

    The ECC error is set in ESM Stat2 register:


  • Thanks Wang.
    I have a couple of questions, request you to answer to it:

    We are using the following controller :
    Controller: TMS570LS31HDK
    CCS Version: 6.2.0.00050

    1. From SPNA126.pdf, in figure 6, it says we need to use nowECC tool for generating the ECC file for the given program image.
    Also, use nowFlash tool for programming both ECC file into Flash ECC area and program into Flash (which starts at 0x00000000).
    If we use CCS6.2 for flashing the image, could see that memory map, Flash ECC is not programmed. So, it seems that it is not getting
    programmed into Flash ECC while using CCS6.2. If this is not programmed, then how SECDED is able to detect single and double bit
    errors?

    2. Using CCS6.2, we have programmed Flash and when we try to read mirrored Flash region, we end up in multi bit ecc error. Any
    reason why, it is not detecting single bit ecc errors?
    Note: we are calling the below function in sys_startup.c ( _coreEnableEventBusExport_();) as it is getting produced from Halcogen.
    and also "_coreEnableFlashEcc_();"

    Regards,
    M.Sreenivasan.
  • Any updates Wang?
  • Hello Sreenivasan,

    1. If you want to use CCS to generate and program the ECC to flash, please enable the "Auto ECC Generation" under "On-Chip Flash" of CCS

    2. Since there is no ECC programmed, the value in ECC area are 0xFFFF which is wrong ECC value for your flash data