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.

CODECOMPOSER: Automatic flashing procedure for DCSM locked chip

Part Number: CODECOMPOSER
Other Parts Discussed in Thread: TMS320F2837

Hi! I am attempting to set up an automatic test environment, which requires a procedure for automatically flashing new software onto target (TMS320F2837). Is there a way to automatically flash a chip that is DCSM locked?

I've tried to use the DSS tool loadti to unlock the chip via GEL function calls (similar to the procedure when debugging in CCS) but have had no luck so far. Is this supposed to work?

All the best

Ricky

  • Hi Ricky,

    To unlock the DCSM, two steps are required:

    • perform a dummy read of the CSM passwords. This will load the CSM passwords stored in OTP into a register inaccessible by the CPU
    • program the CSM passwords in the CSM key registers.

    I'm not familiar with loadti, but as long as you perform the above steps, the DCSM should become unlocked.

    Note that a device reset will re-lock the DCSM zone if any custom password has been programmed in the CSM password fields in OTP.

    Thank you,

    Luke

  • Hi Luke,

    Thanks for the rapid reply.

    To me, it looks like an identical loading procedure (with respect to GEL calls) is performed in loadti when comparing to the procedure performed when starting a debug session in CCS. Please see below debug output from CCS and loadti respectively. Note that the last two debug lines from CCS are output after succssful program load.

    Could there be special considerations required when calling GEL functions from debug server scripts?

    Best regards
    Ricky

    -------- DEBUG OUTPUT WHEN LOADING VIA CCS -------

    C28xx_CPU1: GEL Output: onTargetConnect()
    C28xx_CPU1: GEL Output: ECSLUnlock()
    C28xx_CPU1: GEL Output: Memory Map Initialization Complete
    C28xx_CPU1: GEL Output: onReset()
    C28xx_CPU1: GEL Output: DCSMUnlock()
    C28xx_CPU1: GEL Output: onReset()
    C28xx_CPU1: GEL Output: DCSMUnlock()
    C28xx_CPU1: GEL Output: onReset()
    C28xx_CPU1: GEL Output: DCSMUnlock()
    C28xx_CPU1: GEL Output: onRestart()
    C28xx_CPU1: GEL Output: ECSLUnlock()


    -------- DEBUG OUTPUT WHEN ATTEMPTING LOAD VIA LOADTI UTILITY -------

    .\loadti.bat -a -c <PRIVATE_FILEPATH>.ccxml <PRIVATE_FILEPATH>.out

    ***** DSS Generic Loader *****

    START: 09:35:03 GMT+0200 (CEST)

    Configuring Debug Server for specified target...
    Done
    TARGET: Texas Instruments XDS2xx USB Debug Probe_0
    Connecting to target...
    C28xx_CPU1: GEL Output: onTargetConnect()
    C28xx_CPU1: GEL Output: ECSLUnlock()
    C28xx_CPU1: GEL Output: Memory Map Initialization Complete
    C28xx_CPU1: GEL Output: onReset()
    C28xx_CPU1: GEL Output: DCSMUnlock()

    testEnv.outFiles: <PRIVATE_FILEPATH>.out
    Loading <PRIVATE_FILEPATH>.out
    C28xx_CPU1: GEL Output: onReset()
    C28xx_CPU1: GEL Output: DCSMUnlock()
    C28xx_CPU1: GEL Output: onReset()
    C28xx_CPU1: GEL Output: DCSMUnlock()

    C28xx_CPU1: Warning: Failed unlocking device (zone 1) after reset.
    SEVERE: C28xx_CPU1: Flash Programmer: Error erasing Sector A. FMSTAT value = 1040. Operation Cancelled (0).
    SEVERE: C28xx_CPU1: File Loader: Memory write failed: Unknown error
    SEVERE: C28xx_CPU1: GEL: File: <PRIVATE_FILEPATH>.out: Load failed.
    SEVERE: File: <PRIVATE_FILEPATH>.out: Load failed.
    SEVERE: Error loading "<PRIVATE_FILEPATH>.out": File: <PRIVATE_FILEPATH>.out: Load failed.
    Error code #4011, <PRIVATE_FILEPATH>.out load failed!
    Aborting!

  • Hey Ricky,

    If you've programmed customer DCSM passwords, you may need to edit the GEL file, specifically the contents of the DCSMUnlock() function to successfully unlock the device.

    Let me know if this works once you've provided your custom passwords to the DCSMUnlock() function.

    Thank you,

    Luke

  • Hi Luke,

    The DCSMUnlock() function already contains the custom DCSM passwords and manages to unlock the device before flashing when debugging via CCS but not when attempting to flash using loadti. The same GEL files are used both in CCS and for loadti (via the config file argument -c to loadti). 

    Best regards
    Ricky

  • Hi Ricky,

    I've consulted with other security experts who may be familiar with loadti. I'll let you know once I receive a response.

    Thank you,

    Luke

  • Hi Luke,

    Thank you for your persistance. I will await your response.

    All the best
    Ricky

  • Hey Ricky,

    Can you confirm the following?

    • The same ccxml file is used between CCS and loadti
    • The loadti version being used is the one that comes the CCS version that is being used

    Thank you,

    Luke

  • Hi Luke,

    I can confirm that:
    * The same ccxml file is used in CCS and loadti.
    * I am using CCS v9.3 and executing loadti from the CCS installation dir, i.e. (C:\ti\ccs930\ccs\ccs_base\scripting\examples\loadti\loadti.bat)

    Thanks
    Ricky

  • Hi Ricky,

    Could you try the loadti tool from the latest version of CCS (version 12.7)?

    Thank you,

    Luke

  • Hi Luke,

    I installed CCS v12.7.1 but am sorry to report that I get the exact same behaviour using the loadti tool contained in this installation.

    Any other ideas of what might be the culprit?

    Best regards
    Ricky

  • Hey Ricky,

    Could you send your GEL file?

    Thank you,

    Luke

  • Hi Luke,

    Do you have an email address (or other private forum) that I can send it to? I would prefer to not disclose our GEL file openly in this thread (even after hiding CSM keys).

    Thanks,
    Ricky

  • Hi Ricky, Yes you can send it to l-jones2@ti.com

  • Hi Luke,

    Thank you so much. I've emailed you the GEL file.

    Best regards
    Ricky

  • Thanks Ricky, I'll let you know once I've tested this on my side.

    --Luke

  • Greatly appreciated. Thank you so much!

    Ricky

  • Hey Ricky,

    I was able to run the loadti.bat on a fresh part with no custom CSM passwords, so it seems the issue arises when custom CSM passwords are programmed. I'll try to test this with custom passwords by tomorrow.

    Thank you,

    Luke

  • Hi Luke,

    Thanks for the information and the continued support.

    Best regards
    Ricky

  • Hi again Luke,

    Do you have any updates on this issue? Or perhaps an indication whether it is at all possible to use loadti with custom CSM passwords? Otherwise I may have to resort to writing my own flash program from scratch.

    Thank you,

    Ricky

  • Hi Ricky,

    I wasn't able to determine the cause of this issue. This doesn't seem like an intended use case of loadti so it may not be possible with custom passwords.

    Thank you,

    Luke

  • Hi Luke,

    Thanks for the effort. I will write my own flash program using the flash API.

    Best regards
    Ricky