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.

TMS570LC4357: Does access of unprogrammed flash generate correctable or uncorrectable ECC errors?

Part Number: TMS570LC4357

I am working on a bootloader for TMS570LC4357. I need to check of the application has been programmed or if the Flash address is erased.
1. The erased state of Flash is a known value. If I read it, will this produce a correctable error or uncorrectable error or is it for some reason unpredictable?
2. If my NMI service determines that this error should be ignored, can I return from interrupt or is the offending return address not stored on the stack like other interrupts?

  • Hello,

    1. When you erase the flash, both flash and its ECC are erased. The content of both areas are 0xFFFFFFFF. When you read the flash, you will get an uncorrectable ECC error.

    3. You can program the ECC for the whole flash using linker cmd file of your bootloader.

    http://software-dl.ti.com/hercules/hercules_docs/latest/hercules/Examples/index.html

  • When the bootloader runs, I cannot guarantee that the rest of the Flash address space has valid programming.  There are many scenarios where the programming could get interrupted and the flash is not fully programmed.  In another forum response someone stated that for an uncorrectable error, the offending address is not saved.  What I really want to know is #2 of my original question: If my NMI service determines that this error should be ignored, can I return from the interrupt and resume program execution or is there some difference in the way this interrupt is handled that would prevent that?

  • The ECC values for all of the Flash memory space (Flash banks 0 through 6) must be programmed into the Flash before the program/data can be read. This can be done by generating the correct values of the ECC. The Cortex R5F CPU may generate speculative fetches to any location within the Flash memory space. A speculative fetch to a location with invalid ECC, which is subsequently not used, will not create an abort, but will set the ESM flags for a correctable or uncorrectable error. An uncorrectable error will unconditionally cause the nERROR pin to toggle low. Therefore care must be taken to generate the correct ECC for the entire Flash space including the holes between sections and any unused or blank Flash areas.

  • When reading an unused flash address, the ESM 2.3 will be set. ESM 2.3 can also be set by reading an used location which has ECC error. The flash address which causes the error is not logged. 

  • The Cortex-R5 processor does not provide a mechanism to record the address that caused an uncorrectable ECC fault. It does provide the correctable ECC fault address by exporting the address to the EPC module. The correctable ECC fault address is saved in the EPC module's CAM (content address memory). However, for uncorrectable ECC fault address the R5 processor does not export such information as to which address caused the fault. Please have a look at the EPC module for details.