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.

TMS320F280049: DCSM realization for Bank0

Part Number: TMS320F280049
Other Parts Discussed in Thread: UNIFLASH

Hi Team,

  Could you kindly help to provide solution for F280049 DCSM? The detailed requirement shown as below:

  1. Only Bank0 is required for the password protection, while JTAG connected, need to input the password;  no OTP protection required, no ONLYEXEC protection required. 

  2. Customer has 2 different projects in F280049: Bank0 Sector 0~Sector7 used for user bootloader, others are all used for user application code;

  Expect for your reply, thanks.

Best Regards

Benjamin

  • Benjamin,

    This is doable.

    Assuming customer is only going to use the Zone1, user need to program the GRABSECT and CSM PASSWORD in BANK0 OTP as per the requirement. They can refer the reference code from F2807x device (blinky_with_DCSM) to see how this can be incorporated in existing project.

    Regards,

    Vivek Singh

  • Hi Vivik,
    We have followed the DCSM guide line and the demo, modified 3 files as below, but the device still locked, could you kindly double check below modification?
    1. 28004x——dcsm_lnk.com
    only modified the SECTIONS:
    b0_dcsm_otp_z1_linkpointer : > B0_DCSM_OTP_Z1_LINKPOINTER PAGE = 0

    2. f28004x_dcsm_z1otp.asm:
    .sect "b0_dcsm_zsel_z1"

    ;; .long 0xFFFFFFFF ;B0_Z1OTP_EXEONLYRAM
    ;; .long 0xFFFFFFFF ;B0_Z1OTP_EXEONLYSECT
    ;; .long 0xFFFFFFFF ;B0_Z1OTP_GRABRAM
    ;; .long 0x55555555 ;B0_Z1OTP_GRABSECT All Sector in Zone 1

    ;; .long 0x11223344 ;B0_Z1OTP_CSMPSWD0 (LSW of 128-bit password)
    ;; .long 0x11223344 ;B0_Z1OTP_CSMPSWD1
    ;; .long 0x11223344 ;B0_Z1OTP_CSMPSWD2
    ;; .long 0x11223344 ;B0_Z1OTP_CSMPSWD3 (MSW of 128-bit password)

    .sect "b1_dcsm_zsel_z1"
    ;; .long 0xFFFFFFFF ;Reserved
    ;; .long 0xFFFFFFFF ;B1_Z1OTP_EXEONLYSECT
    ;; .long 0xFFFFFFFF ;Reserved
    ;; .long 0xAAAAAAAA ;B1_Z1OTP_GRABSECT

    3. f28004x_sysctrl.c

    Uint16
    CsmUnlock()
    {
    //
    // Write to the key registers to unlock the device. The 0x0FFFFFFFF's
    // are dummmy passwords. User should replace them with the correct password
    // for the DSP.
    // Note: F28004x has default password keys which are not all 0xFFFFFFFF.
    // See DCSM chapter of Technical Reference Manual for default passwords.
    EALLOW;

    DcsmBank0Z1Regs.Z1_CSMKEY0 = 0x11223344;
    DcsmBank0Z1Regs.Z1_CSMKEY1 = 0x11223344;
    DcsmBank0Z1Regs.Z1_CSMKEY2 = 0x11223344;
    DcsmBank0Z1Regs.Z1_CSMKEY3 = 0x11223344;

    DcsmBank0Z2Regs.Z2_CSMKEY0 = 0xFFFFFFFF;
    DcsmBank0Z2Regs.Z2_CSMKEY1 = 0xFFFFFFFF;
    DcsmBank0Z2Regs.Z2_CSMKEY2 = 0xFFFFFFFF;
    DcsmBank0Z2Regs.Z2_CSMKEY3 = 0xFFFFFFFF;
    EDIS;

    return 0;
    }

    Expect for your reply, thanks.

    Best Regards
    Benjamin
  • Benjamin,

     

    We have very little info about the issue. Can you provide below info to understand the issue further.

     

    How many zones you are using in this case?

    Which flash sectors and RAMs you want to secure?

    Have you already programmed the passwords in any of the zone?

    Are you able to unsecure the zone by writing the passwords into KEYx registers?

     

    Regards,

    Vivek Singh

  • Hi Vivek,
    How many zones you are using in this case?
    Benjamin: only Zone 1 is being used for this case;

    Which flash sectors and RAMs you want to secure?
    Benjamin: All sectors of FLASH Bank0 should be protected, no RAM secure required;

    Have you already programmed the passwords in any of the zone?
    Benjamin: Tired 2 boards with CCS to program the passwords and configured the properties->DEBUG->Flash Settings, the devices been locked, tired 1 board for using Uniflash to program the passwords;

    Are you able to unsecure the zone by writing the passwords into KEYx registers?
    Benjamin: all of the 3 boards were locked by change the .gel file and using Launch target configurations->DEBUG->Connect->input KEYx; still failed.

    Currently no other boards for the test, and need your kindly support for provide demo source code.

    Best Regards
    Benjamin
  • Benjamin,

    If you are only using Zone1 then should not be writing the password for Zone2. Please note on this device default password value is not all_1 so when you write all_1 as key, it locks the Zone2. I am not sure if that is the issue in this case but you should avoid doing that. Also to unlock, you need to load the password from USER OTP location which is missing in your unlock function. You can refer the Gel file to see the code for same. Let's discus this further in call today.

    Regards,

    Vivek Singh
  • Benjamin,

    Any further update on this?

    Vivek Singh