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: Need more information on CheckFlashECC

Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN

Hi Team,

We are using CCS8.0 and trying to load the image using Flash (F021) API calls instead of CCS8.0.
With this, image is loaded successfully and after loading, we try to reset the CPU (using CCS8.0 by loading symbols only) and could see that double bit exception handler is getting called during checkFlashECC.

This is not happening when we try to flash image using CCS8.0. Do we need to do execute any Flash API calls after loading the image into flash, prior to CPU reset?

Can you please explain the reason for this behavior.

Regards,
M.Sreenviasan.

  • Hello Sreenviasan,

    Flash diagnostics must be run from SRAM. Please define a code section in SRAM, and execute the flash selftest from this code section.
  • Hi Wang,

    I mentioned that when we flash the image using CCS it was working but not the same when flashing image without using CCS.
    In both cases, code will be loaded into flash and will execute checkFlashECC from flash. Can you please look into this?

    Regards,
    M.Sreenivasan.
  • Hi Wang,

    After performing flash write operation using F021 API's, and after cpu reset, we are seeing double bit ecc exceptions. This is not the case when we do power on reset after F021API's.
    Also, when we flash the image using CCS, we are not seeing any issues.

    Can you please look into this and let us know is there anything that we have to do after programming flash with F021 API calls?

    Regards,
    M.Sreenivasan.
  • Hi M.Sreenivasan,

    When you program the code to flash using F021 flash API, did you calculate and program the ECC at the same time? You can use the option in Fapi_issueProgrammingCommand(..) function. Also, please program 16 bytes data at a time. If you write 1 byte at a time, you can program a wrong ECC.

    Fapi_issueProgrammingCommand((uint32_t *)dst,
    (uint8_t *)src,
    (uint32_t) 16,
    0,
    0,
    Fapi_AutoEccGeneration);
  • Hi Wang,

    We are writing 8 bytes at a time. Do you see any issue if we use 8 bytes of data programming flash at a time ?

    Regards,
    M.Sreenivasan.

  • Hi Wang,

    We are using the same above command with 8 bytes at a time. Please let me know if you need further information.
    We are able to see the problem (double bit ECC exceptions coming from Flash) randomnly after CPU reset (from CCS8.0) once Flash programming is completed.

    Regards,
    M.Sreenivasan.

  • Hi M.Sreenivasan,

    I am wondering if the error is caused by speculative fetch to a location with invalid ECC. Can you capture the address where you get the ecc error? When you program the flash using F021 APIs, how do you handle the data if the number of data in your last write is less than 8 bytes? I recommend to append 0xFF. You can also try to use the linker cmd to generate ECC.
  • Hi Wang,

    Below are responses:

    Q: Can you capture the address where you get the ecc error?

    A:  Once the new image is loaded using FLash API's and processor is reset using CCS, flash ECC error occurs at "checkFlashECC()" function which is part of sys_startup.c file generated by HALCOGEN.

    Q: how do you handle the data if the number of data in your last write is less than 8 bytes? I recommend to append 0xFF. You can also try to use the linker cmd to generate ECC.

    A:  Yes, we are appending 0xFF if number of bytes to be programmed is less than 8 bytes.

    Thanks,

    Kalyan

  • Hi Wang,

    Any updates on this? Please do share your observations.

    Regards,
    M.Sreenivasan.
  • Hello,

    checkFlashECC() is used for ECC diagnostic (mode 7). If this function is called twice for the same flash location:

    /* read a flash location from the mirrored memory map */
    flashread = flashBadECC1;

    Only the first call generates ECC error, the 2nd call will not generate ECC error.