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.

How to unlock protection with CCSV6

Other Parts Discussed in Thread: TMS320F2812

The target was locked (TMS320F2812)  by a password. How to unlock the target with CCS6.

When I start to debug, the following error is shown:

"0C28xx: Flash Programmer: Device is locked or not connected. Operation cancelled.

C28xx: GEL: File: C:\A_CCS6.0_Project\FL4000_OriginalFirmware_CCS6.0\FLIR\Debug\FL4000.out: Load failed."

I am sure that the target is connected, because "Test Connect" is working, and the program was down load successfully a minute ago with the protection enabled with password.

  • Hi,

    Wing Lam39 said:
    The target was locked (TMS320F2812)  by a password. How to unlock the target with CCS6.

    If you check the SysCtrl.c source file in your project, it has a CSM_Unlock routine and it looks something like this:

    Uint16 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 = 0xFFFF;
        CsmRegs.KEY1 = 0xFFFF;
        CsmRegs.KEY2 = 0xFFFF;
        CsmRegs.KEY3 = 0xFFFF;
        CsmRegs.KEY4 = 0xFFFF;
        CsmRegs.KEY5 = 0xFFFF;
        CsmRegs.KEY6 = 0xFFFF;
        CsmRegs.KEY7 = 0xFFFF;
        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 succes, otherwise return
        // failure.
        if (CsmRegs.CSMSCR.bit.SECURE == 0) return STATUS_SUCCESS;
        else return STATUS_FAIL;
    
    }

    Regards,

    Gautam