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/TMS320F28377S: Securing Code so the device will boot properly

Part Number: TMS320F28377S

Tool/software: Code Composer Studio

I want to lock down some code on this processor. I followed the example of Blinky-DCSM and added an .asm file that locked my processor.  This part worked.  If I do not have the correct password in CCS7 I cannot see the code.  If I add the correct password, I can step and see the code.  However, now I can only run the code from CCS7 -- it will not boot and run on restart as it used to.  

My asm file contains the following code without my password. (I intend to lock down FLASHD and RAMLS0 because my code starts in FLASHD and gets copies to RAMLS0 on boot.  What am I doing wrong that stopped it from booting without CCS7 once secured?  Regards

      .sect "dcsm_otp_z1_linkpointer"
    .long 0x1FFFFFFF     ;Z1-LINKPOINTER1
    .long 0xFFFFFFFF     ;Reserved
    .long 0x1FFFFFFF     ;Z1-LINKPOINTER2
    .long 0xFFFFFFFF     ;Reserved
    .long 0x1FFFFFFF     ;Z1-LINKPOINTER3
    .long 0xFFFFFFFF     ;Reserved

      .sect "dcsm_otp_z1_pswdlock"
    .long 0x00000000     ;Z1-PSWDLOCK
    .long 0xFFFFFFFF     ;Reserved

      .sect "dcsm_otp_z1_crclock"
    .long 0xFFFFFFFF     ;Z1-CRCLOCK
    .long 0xFFFFFFFF     ;Reserved

      .sect "dcsm_otp_z1_bootctrl"
    .long 0xFFFFFFFF     ;Reserved
    .long 0xFFFFFFFF     ;Z1-BOOTCTRL

      .sect "dcsm_zsel_z1"

    .long 0xFFFFFFFF      ;Z1-EXEONLYRAM
    .long 0xFFFFFFFF      ;Z1-EXEONLYSECT
    .long 0xFFFFFFFD      ;Z1-GRABRAM
    .long 0xFFFFFFBF      ;Z1-GRABSECT

  • Hi Neil,

    Couple of things to check -

    1) Value of BOOTMODE pins - Make sure these pins are set to 1/1 (GetMode) on board.

    2) Please check that you are configuring the ECC value for all the security settings correctly. It'll be programmed by flash programmer automatically as long as it's not disabled. While running with CCS, Gel file disables ECC so it will work ok even if ECC values are not programmed. You can remove that code from Gel file and see if still work ok with CCS.

    Regards,

    Vivek Singh

  • Vivek,

    Thank you for the info but I am not sure I understand. How would I set the BOOTMODE pins? Is that in CCS7? If so, where would I find that?

    Where do I configure the ECC value? Is that in the .asm file? CCS7? How would I do this?

    I do not see full documentation on either of these in the user manual, spruhx5e.

    Thanks,

    Neil
  • Hi Neil,

    GPIO72 and GPIO84 are BOOTMODE pins which should be driven to 1/1 on the board. Which board you are using?

    About ECC programming, no, you don't have to configure it in .asm file. If you have not disabled it in Flash plug-in then flash programmer will program it automatically.

    Did you try removing the ECC disable code from the Gel file and see if it still works fine with CCS ?

    Vivek Singh
  • Hi Vivek,

    We are using the Launchpad with the F28377s.  We put the board in GetMode by switching the Boot DIP so TRST is off (leaving GPIO84 and GPIO72 on).

    The Gel file has the following two lines:

    *(int *)0x5FB00 = 0; /* Disable CPU1-FMC Flash ECC */
    *(int *)0x5FF00 = 0; /* Disable CPU2-FMC Flash ECC */

    Do I remove these?  assign a different value to them?

    Thanks

  • We commented out the two lines above and the behavior is the same -- Boots and runs from CCS7 but will not boot on its own.
  • Hi Neil,

    After commenting out these line, you need to re-launch the target and connect to CCS again so that changes made takes effect. Have you done that?

    Regards,

    Vivek Singh