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.

TMS320F28035: TMS320F28035

Part Number: TMS320F28035

I am working on TMS320F28035 SCI Bootloader, everthing is working well , but csmUnlock not working in case i lock the device with fix password. i have done change in kernel file

Uint16 CsmUnlock()
{

/*volatile int *CSM = (volatile int *)0x000AE0; //CSM register file
volatile int *PWL = (volatile int *)0x003F7FF8; //Password location
volatile int tmp;
int I;
// Read the 128-bits of the password locations (PWL)
// in flash at address 0x3F 7FF8 - 0x3F 7FFF
// If the device is secure, then the values read will
// not actually be loaded into the temp variable, so
// this is called a dummy read.
for (I=0; I<8; I++) tmp = *PWL++;
// If the password locations (PWL) are all = ones (0xFFFF),
// then the device will now be unsecure. If the password
// is not all ones (0xFFFF), then the code below is required
// to unsecure the CSM.
// Write the 128-bit password to the KEY registers
// If this password matches that stored in the
// PWL then the CSM will become unsecure. If it does not
// match, then the device will remain secure.
// An example password of:
// 0x11112222333344445555666677778888 is used.
asm(" EALLOW"); // Key registers are EALLOW protected
*CSM++ = 0x1234; // Register KEY0 at 0xAE0
*CSM++ = 0xFFFF; // Register KEY1 at 0xAE1
*CSM++ = 0xFFFF; // Register KEY2 at 0xAE2
*CSM++ = 0xFFFF; // Register KEY3 at 0xAE3
*CSM++ = 0xFFFF; // Register KEY4 at 0xAE4
*CSM++ = 0xFFFF; // Register KEY5 at 0xAE5
*CSM++ = 0xFFFF; // Register KEY6 at 0xAE6
*CSM++ = 0xFFFF; // Register KEY7 at 0xAE7
asm(" EDIS");*/
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;
CsmRegs.KEY0 = 0x1234;
CsmRegs.KEY1 = 0xFFFF;
CsmRegs.KEY2 = 0x5678;
CsmRegs.KEY3 = 0xFFFF;
CsmRegs.KEY4 = 0x4321;
CsmRegs.KEY5 = 0xFFFF;
CsmRegs.KEY6 = 0x8765;
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;

}

with fix password which i have already locked device

  • Hi,

    The subject matter expert assigned to this thread is out of office this week due to the end-year holidays so you may not get a qualified answer until Jan first week.  I apologize for the delay.

     

    Regards,

    Himanshu

     

  • Hello, 

    When posting short pieces of code, please use the code format syntax highlighter.  It looks like </> on the edit bar.  It will make the code much easier to read.

    In this code I see KEY0 is modified and all the others are 0xFFFF 

    asm(" EALLOW"); // Key registers are EALLOW protected
    *CSM++ = 0x1234; // Register KEY0 at 0xAE0
    *CSM++ = 0xFFFF; // Register KEY1 at 0xAE1
    *CSM++ = 0xFFFF; // Register KEY2 at 0xAE2
    *CSM++ = 0xFFFF; // Register KEY3 at 0xAE3
    *CSM++ = 0xFFFF; // Register KEY4 at 0xAE4
    *CSM++ = 0xFFFF; // Register KEY5 at 0xAE5
    *CSM++ = 0xFFFF; // Register KEY6 at 0xAE6
    *CSM++ = 0xFFFF; // Register KEY7 at 0xAE7
    asm(" EDIS");*/
    volatile Uint16 temp;

    But here I see every other key is modified.   Have you tried unlocking the device with all Keys matching? 

    ....
    CsmRegs.KEY0 = 0x1234;   <---
    CsmRegs.KEY1 = 0xFFFF;
    CsmRegs.KEY2 = 0x5678;   <---
    CsmRegs.KEY3 = 0xFFFF;
    CsmRegs.KEY4 = 0x4321;   <---
    CsmRegs.KEY5 = 0xFFFF;
    CsmRegs.KEY6 = 0x8765;   <---
    CsmRegs.KEY7 = 0xFFFF;
    EDIS;

    Regards

    Lori