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/TMS320F28335: CSM blocks code execution

Part Number: TMS320F28335

Tool/software: Code Composer Studio

We are working with the DSP TMS320F28335 and we are planning to use the CSM to secure the code.

To do this we've added to the project the file "DSP2833x_CSMPasswords.asm", and in order to test it we've written the file like this:

;// TI File $Revision: /main/3 $
;// Checkin $Date: June 26, 2007   16:41:07 $
;//###########################################################################
;//
;// FILE:	DSP2833x_CSMPasswords.asm
;//
;// TITLE:	DSP2833x Code Security Module Passwords.
;// 
;// DESCRIPTION:
;//
;//         This file is used to specify password values to
;//         program into the CSM password locations in Flash
;//         at 0x33FFF8 - 0x33FFFF.
;//
;//         In addition, the reserved locations 0x33FF80 - 0X33fff5 are 
;//         all programmed to 0x0000
;//
;//###########################################################################
;//
;// Original source based on D.A.
;// 
;// $TI Release: DSP2833x/DSP2823x C/C++ Header Files V1.31 $
;// $Release Date: August 4, 2009 $
;//###########################################################################

; The "csmpasswords" section contains the actual CSM passwords that will be
; linked and programmed into to the CSM password locations (PWL) in flash.  
; These passwords must be known in order to unlock the CSM module. 
; All 0xFFFF's (erased) is the default value for the password locations (PWL).

; It is recommended that all passwords be left as 0xFFFF during code
; development.  Passwords of 0xFFFF do not activate code security and dummy 
; reads of the CSM PWL registers is all that is required to unlock the CSM.  
; When code development is complete, modify the passwords to activate the
; code security module.


      .sect "csmpasswds"

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

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

; For code security operation, all addresses between 0x33FF80 and
; 0X33fff5 cannot be used as program code or data.  These locations
; must be programmed to 0x0000 when the code security password locations
; (PWL) are programmed.  If security is not a concern, then these addresses
; can be used for code or data.  

; The section "csm_rsvd" can be used to program these locations to 0x0000.

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

;//===========================================================================
;// End of file.
;//===========================================================================

This is the file copied and pasted.

When we compile and load this code into the DSP it works fine and without problem even after we stop the debugging. The problem comes when we turn off and on the DSP or when we reset the DSP, the DSP does not execute code and it seems like it is stuck on reset.

The DSP can be unlocked and reprogrammed, but if we load anything with a password different than all 0xFFFF the DSP won't execute code from FLASH. The same thing also happens when we load the code through the SCI.

Supposely the sections of code are well assigned (This is part of the TMS320F28335.cmd):


    CSM_RSVD    : origin = 0x33FF80, length = 0x000076         /* Program with all 0x0000 when CSM is in use. */
    BEGIN       : origin = 0x33FFF6, length = 0x000002         /* Used for "boot to Flash" bootloader mode. */
    CSM_PWL     : origin = 0x33FFF8, length = 0x000008         /* CSM password locations in FLASH */


    codestart           : > BEGIN PAGE = 0

    csmpasswds          : > CSM_PWL     PAGE = 0
    csm_rsvd            : > CSM_RSVD    PAGE = 0

And as a side note to specify my case, this was not tested only with 1 DSP, it happens with all the DSP we are testing (all of them are the TMS320F28335).

In the project we also have the file "DSP2833x_Headers_BIOS.cmd" because we are using TI-RTOS, I don't know if this influences anything.

Thanks for the help.