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.

[FAQ] TMS570LC4357: After erasing, the flash contents should become 0xFFFFFFFF. Why the flash content in CCS memory browser is not 0xFFFFFFFF?

Part Number: TMS570LC4357

After the flash is erased, why the flash content doesn't become 0xFFFFFFFF?

  • Hi,

    The Flash memory is protected by Single Error Correction Double Error Detection (SECDED). This protection is enabled by the SECDED circuit inside of the CPU.  For TMS570LC43x and RM57Lx ARM Cortex-R5 based MCUs, the SECDED logic inside the CPU is permanently enabled by default. But for TMS570LSx ARM Cortex-R4F based devices, the flash ECC is not enabled by default and must be enabled by the application.

    There is an 8-bit ECC for every 64 bits of data. The ECC for the flash region is stored in the flash itself, and is mapped to a region starting at 0xF0400000 for the main flash bank 0. 

    When the flash is erased, it's ECC region is also erased. The content in both regions are 0xFFFFFFFF, this means that the ECC region has wrong ECC value (0xFF) for the content (0xFFFFFFFFFFFFFFFF) in main flash region. When reading from the flash region, the SECDED logic will detect the ECC/data error and correct the single-bit errors. This is why the some bit of content in CCS browser is flipped. 

    One solution is to use the Linker CMD file to generate ECC. Please see my note regarding the generating ECC using Linker CMD file:

    https://software-dl.ti.com/hercules/hercules_docs/latest/hercules/How_to_Guides/HowToGuides.html#launchxl2-570lc43-rm57l-linkereccrecommendation