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.

CSM and Passwords.asm

Other Parts Discussed in Thread: CONTROLSUITE

Hello,

Example "Running an Application from Internal Flash Memory on the TMS320F28xx DSP (Rev. H)" has a file Passwords.asm. This file has the following comment:

* 4) The section "csm_rsvd" is required when using code security.
* Failure to program addresses 0x33FF80 through 0x33FFF5 in the
* flash to all 0x0000 can compromise security.

and code:

.sect "csm_rsvd"
.loop (33FFF5h - 33FF80h + 1)
  .int 0x0000
.endloop

Does this piece of code initialize csm_rsvd section with 0x0000 values, in other words turns CSM on?

 

The project I have is based on this example. It works fine from flash when programmed with JTAG. I can do it many times, so it seems that CSM module is switched off.

But the problem now for me is how to program flash via RS232. After trying to programm flash via RS232 using C2000prog.exe I have the locked processor :(

How to be sure that CSM is switched off in my project?

 

Thanks.

  • There are two things needed to enable security:

    1) program all 0's to 0x33FF80 - 0x33FFF5

    2) program a password to 0x33FFF8 - 0x33FFFF.   Somewhere in the project there will be a section with the data for the CSM. 

    In the Header Files and Peripheral Examples flash projects it is in the  <device>_CSMPasswords.asm file and looks like this.  If you wanted to program a password you would change the values from 0xFFFF to the password of choice.

          .sect "csmpasswds"

          .int    0xFFFF        ;PWL0 (LSW of 128-bit password)
          .int    0xFFFF        ;PWL1
          .int    0xFFFF        ;PWL2
          .int    0xFFFF        ;PWL3
          .int    0xFFFF        ;PWL4
          .int    0xFFFF        ;PWL5
          .int    0xFFFF        ;PWL6
          .int    0xFFFF        ;PWL7 (MSW of 128-bit password)

    If the password is not programed (ie all bits are left as F's - erased state) then the CSM can simply be unlocked by performing a read of the password.   In Code Composer Studio the easiest way to do this is to open a memory window to view the password locations.  You may need to referesh the window once to get the device to unlock.  If they read back 0x0000 after a refresh then the device is locked. There is also a bit in the CSMSCR register you can check to see if the CSM is unlocked.

    If you program a password then the matchflow has to be done in order to unlock the CSM. 

    The CSM, match flow, CSMSCR register are all described in the System Control and Interrupts Guide - from your memory locations it looks like this is a 2833x or 2823x device in which case this is the device specific guide:

    http://www.ti.com/lit/sprufb0

    -Lori

     

  • Hi Lori

    I followed the steps you have mentioned in this forum post, but when using CCSv4 and Setting a password for example

    But when we click on debug option, we are getting a flash API time out which is leading to device being locked permanently. Do you have any suggestions what must be wrong with our settings.

    We are trying the standard Example_28335_Flash project from controlSUITE. Just changed one password location as AAAA.

    CCSv4 does not show the flash API version number. Where do we look for the same. We do not have any breakpoints also hence all precautions have been taken care. 

     

     

    .sect "csmpasswds"

     

     

     

    .int 0xAAAA ;PWL0 (LSW of 128-bit password)

     

     

    .int 0xFFFF ;PWL1

     

     

    .int 0xFFFF ;PWL2

     

     

    .int 0xFFFF ;PWL3

     

     

    .int 0xFFFF ;PWL4

     

     

    .int 0xFFFF ;PWL5

     

     

    .int 0xFFFF ;PWL6

     

     

    .int 0xFFFF ;PWL7 (MSW of 128-bit password)

     

    ;----------------------------------------------------------------------

     

     

     

     

    .sect "csm_rsvd"

     

     

    .loop

    (33FFF5h - 33FF80h + 1)

     

     

    .int 0x0000

     

     

    .endloop

    With Regards

    Pravin Angolkar

    FAE India