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.

CCS/TMS320F28035: Unlock ECSL protection

Part Number: TMS320F28035
Other Parts Discussed in Thread: UNIFLASH

Tool/software: Code Composer Studio

Hi,

I used ECSL (low 64-bits of the CSM key) protection to disable JTAG emulation.

How can I unlock the device, enable the emulation from the code?

I use the unlock example function running from secure SARAM with the correct key in the .ASM file but it's wont work.

What did i do wrong?

Best regards,

Tom

  • Tom,

    You need to write the correct ECAL passwords in KEY register to unlock the ECSL. It can be done from code or via CCS Gel file. If want to do this via CCS Gel file then you have to change the BOOT pin setting as below -

    Regards,

    Vivek Singh 

  • Vivek,

    it's not working through the code.

    This what I doing:

    1. I wrote code that use this function - "Status = Example_CsmUnlock()" to unlock the device.
    2. I change default key on "Expample_Flash2803x_CsmKeys.asm" file to 0xFFF1 (_PRG_key0 -_PRG_key7)
    3. I locked my device on CCS Uniflash 3 (Key0 - Key7 = 0xFFF1 )

    Best regards,

    Tom
  • Hi Tom,

    Can you please share your Example_CsmUnlock() function code.

    Vivek Singh
  • Vivek,

    This this my code (I run it from L0 SARAM):


    if (GpioDataRegs.GPADAT.bit.GPIO10 == 1)
    {
    Status = Example_CsmUnlock();
    }

    //---------------------------------------------------------------------------
    // Example: CsmUnlock:
    //---------------------------------------------------------------------------
    // This function unlocks the CSM. User must replace 0xFFFF's with current
    // password for the DSP. Returns 1 if unlock is successful.

    Uint16 Example_CsmUnlock()
    {
    volatile Uint16 temp;

    // Load the key registers with the current password. The 0xFFFF's are dummy
    // passwords. User should replace them with the correct password for the DSP.

    EALLOW;
    CsmRegs.KEY0 = 0xFFF1;
    CsmRegs.KEY1 = 0xFFF1;
    CsmRegs.KEY2 = 0xFFF1;
    CsmRegs.KEY3 = 0xFFF1;
    CsmRegs.KEY4 = 0xFFF1;
    CsmRegs.KEY5 = 0xFFF1;
    CsmRegs.KEY6 = 0xFFF1;
    CsmRegs.KEY7 = 0xFFF1;
    EDIS;

    // Perform a dummy read of the password locations
    // if they match the key values, the CSM will unlock

    temp = CsmPwl.PSWD0;
    temp = CsmPwl.PSWD1;
    temp = CsmPwl.PSWD2;
    temp = CsmPwl.PSWD3;
    temp = CsmPwl.PSWD4;
    temp = CsmPwl.PSWD5;
    temp = CsmPwl.PSWD6;
    temp = CsmPwl.PSWD7;

    // If the CSM unlocked, return success, otherwise return
    // failure.
    if (CsmRegs.CSMSCR.bit.SECURE == 0) return STATUS_SUCCESS;
    else return STATUS_FAIL;

    }


    Best regards,

    Tom
  • Hi Tom,

    Sorry for late reply. Have you check the assembly code to make sure password read section is not optimized. Since temp is not used anywhere in the code later compiler may optimize the same.

    Regards,

    Vivek Singh