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: ECC Issue - Unable to Access Flash Memory

Part Number: TMS570LC4357
Other Parts Discussed in Thread: UNIFLASH, TMDX570LC43HDK, LAUNCHXL2-570LC43

Tool/software:

I'm experiencing an issue with the TMS570LC4357 microcontroller related to Error-Correcting Code (ECC). After enabling ECC, updating the ECC location in the command file, and loading the code into the controller, I'm no longer able to:

1. Load any code (with or without ECC)
2. Erase flash memory
3. Perform any operations on flash memory

However, I'm able to:

1. Connect to the board
2. Test the connection successfully using Code Composer Studio

3. Read registers

4. Enter into debug mode and execute pre-existing code line by line

  • ECC enabled from project properties -> Build -> Arm linker -> Advance options -> linker Ouput -> control whether ECC generation is on or off -> set to on
  • ECC locations updated in CMD file:

                For example:

                                  Flash_location          : origin = 0x00020000, length = 0x7BE0 

                               Flash ECC   : origin = 0xF0401000 length = 0xF7C ECC = { input_range = Flash_location}

  • Auto ECC generation disabled from debug configuration.

Has anyone encountered a similar issue? If so, any guidance or solutions would be greatly appreciated.

  • Hi Jishnu,

    1. ECC Behavior on TMS570LC4357:
    • The SECDED (Single-bit Error Correction and Double-bit Error Detection) module is enabled by default on the TMS570LC4357 and cannot be disabled
    • This is a permanent configuration for this device, meaning ECC is always in enabled mode
    1. Understanding the Issue: The root cause of your flash programming issues appears to be related to how ECC works on this device. When flash is erased:
    • The flash content becomes 0xFFFFFFFF
    • The corresponding ECC space is also erased to 0xFFFFFFFF
    • This creates an invalid ECC value for the flash content
    • Since SECDED is enabled by default, the ECC logic attempts to correct 1-bit errors, which is why some bits appear incorrect after erasure
    1. Solution Approach: To resolve your issue, consider the following:

    a) For Flash Programming:

    • Ensure you're using the correct ECC generation method
    • Try using the Fapi AutoEccGeneration mode if available
    • Make sure the ECC values are properly calculated and written for your flash content

    b) For your specific CMD file configuration:

    • Verify that the ECC locations are correctly mapped to their corresponding flash regions
    • Ensure the length parameters for both flash and ECC regions are properly calculated
    1. Important Notes:
    • The ECC ENABLE register doesn't control ECC programming; it only controls the evaluation of data read from flash for ECC errors
    • When writing valid data later into the memory, the correct ECC value will be calculated and written into the ECC region automatically

    Recommendations:

    1. Double-check your ECC region mappings in the command file
    2. Ensure you're using proper flash programming tools that understand ECC requirements
    3. Consider using a bootloader approach if needed, as the device will always execute code from flash
    4. Make sure any flash programming operations include proper ECC value generation

    Would you be able to share:

    1. The exact flash programming tool you're using?
    2. The complete command file configuration?
    3. Any error messages you're receiving during flash operations?

    This additional information would help provide more specific guidance for your situation.

    --
    Thanks & regards,
    Jagadish.

  • Hi Jagadish,

    Thanks for the detailed explanation regarding the ECC behavior on the TMS570LC4357.  However, I’m still encountering significant issues using controllers that have experienced ECC errors. Unfortunately, after ECC errors occur, the affected controllers become inaccessible for normal flashing or erasing procedures.

    Programming Tools and Versions

    • Code Composer Studio: Version 10.1.1.00004

    • Compiler: ti-cgt-arm_20.2.4.LTS

    • Uniflash: 9.2.0.5300 (Cloud version not yet tried)

    Boards Involved

    • We see this problem consistently on 4 boards—specifically, 2 LAUNCHXL2-570LC43 kits and 2 TMDX570LC43HDK Hercules TMS570LC43x Development Kits.

    • The issue manifests on both TI development boards, not tested in custom hardware.

    Observed Behavior

    • When attempting to flash using CCS, the debug session fails before flash erase starts; CCS crashes and closes without warning, which prevents new code from being loaded.

    • Uniflash also fails to erase or access flash on these affected boards (cloud versions not tested).

    • The controllers become essentially unusable after ECC errors, making conventional recovery impossible with current toolsets.

    Error Messages

    • The main error observed in CCS is:

      text
      CortexR5: File Loader: Memory write failed: Flash algorithm returned an error during Flash programming. Note: Auto ECC generation is on, please make sure that the data sections are 64-bit memory aligned in your linker file; alternately, turn off Auto ECC generation in the On-Chip Flash settings CortexR5: GEL: File: Z:/.../../../BUILD/Debug/CODE.out.tek: Load failed.

      This error only appears once—any subsequent attempt to load code results in the CCS IDE abruptly closing, with no further error output.

    • In the past, a different error referencing DAP eror was encountered, but that too ceased appearing after the board entered this locked state.

    Additional Recovery Attempts

    • Advice found elsewhere suggests using a "Force Mass Erase" option if prompted with "Device locked," but neither CCS nor Uniflash appears to provide this feature. If such an option exists, guidance on accessing it would be welcome.

    Request for Further Guidance
    Is there any known procedure to recover boards affected by persistent ECC errors, or does this situation require device replacement? Any clarification around device unlocking, mass erase features, or additional troubleshooting steps would be greatly appreciated.

    Best regards,
    Jishnu

     

  • Hi Jishnu,

    Apologies for the delayed response!

    The main error observed in CCS is:

    text
    CortexR5: File Loader: Memory write failed: Flash algorithm returned an error during Flash programming. Note: Auto ECC generation is on, please make sure that the data sections are 64-bit memory aligned in your linker file; alternately, turn off Auto ECC generation in the On-Chip Flash settings CortexR5: GEL: File: Z:/.../../../BUILD/Debug/CODE.out.tek: Load failed.

    I found very similar issue here:

    (+) CCS/TMS570LS0432: Flash algorithm returned error; Data section not 64-bit aligned - Issue with ECC - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums

    Here the root cause for the issue is that utilizing higher .bss section memory.

    So, let's confirm whether this issue is occurring for one particular code or every code. Take one small example and try with that once if it worked fine then we can verify further in code what went wrong.

    The other reason could be:

    Alignment issue, to program the device immediately, you can temporarily disable Auto ECC generation and verify once.

    --
    Thanks & regards,
    Jagadish.