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.

MSP430FR2155: JTAG Lock with Password

Part Number: MSP430FR2155
Other Parts Discussed in Thread: MSP430FR6972,

Hi there,

In one of my customised board containing MSP430FR6972, I am using JTAG Lock With password protection feature and I provide that password via MSP430 Flasher to update the firmware later.

For MSP430FR6972, I am using the following code outside main,

/*
 * Lock the JTAG with password.
 *
 * Setting 0xAAAA for JTAG signature 1 on FR5xx/6xx devices locks the device
 * with a password. JTAG signature 2 is the password length in words.
 * The only way back into device is to provide the password via the toolchain.
 */
#pragma location = 0xFF80
__root const unsigned int JTAG_signatures[] = {0xAAAA, 0x0002};

/*
 * Set the password.
 *
 * To access the device again after JTAG password is enabled, provide the
 * password in the Project Options under Debugger > FET Debugger, on the 
 * Download tab. 
 * In the box for JTAG Password: (Hex format) write the password in words, with 
 * the least significant word first. In this example, provide the password 
 * "0x34127856" if "__root const uint8_t JTAG_password[] = {0x12, 0x34, 0x56, 0x78};"
 *
 * To disable JTAG password again, load any project that does not have a JTAG
 * password defined - remember to provide the correct password to be able to
 * load this new project the first time.
 */

#pragma location = 0xFF88
__root const unsigned char JTAG_password[] = {0x01, 0x02, 0x03, 0x04};
// Password = 0x02010403

In my other customised board with MSP430FR2155, I am not being able to lock the JTAG with password. So that I can update the firmware using that password protection later.

It will be wonderful if anyone can provide a sample code for that.

Regards,

Harish KS

  • Hi Harish,

    The "JTAG Lock With password protection feature" looks to be only available in FR5xx and FR6xx devices. You can see the summary of this feature's applicable devices in Section 2.4, JTAG Access Protection's Table 11 Overview Of Memory Protection Mechanisms of the application note "MSP430™ Programming With the JTAG Interface" at http://www.ti.com/lit/slau320

    Below is the relevant entry from the table:

    Srinivas

  • In IAR here is how to do it:

    const uint16_t jtag_signature1 @ "JTAG_SIGNATURE1" = 0xAAAA;
    const uint16_t jtag_signature2 @ "JTAG_SIGNATURE2" = 0x0004;
    const uint64_t jtag_password   @ "JTAG_PASSWORD"   = 0x0123456789abcdef;
    //-----------notes on how to use JTAG locked with password:
    //  88=ef, 89=cd ---> 8D=45, 8F=01       IAR JTAG PW: 0xcdef89ab45670123
    // cdef | 89ab | 4567 | 0123
    // 8988 | 8B8A | 8D8C | 8F8E <-- FF88 - FF8F

    Then somewhere in the file:
    #pragma required=jtag_signature1
    #pragma required=jtag_signature2
    #pragma required=jtag_password
    
    IAR linker file:
    // ---------------------------------------------------------
    // JTAG signature
    -Z(CONST)JTAG_SIGNATURE1=FF80-FF81
    -Z(CONST)JTAG_SIGNATURE2=FF82-FF83
    
    // for JTAG Signature of two words:
    //-Z(CONST)JTAG_PASSWORD=FF88-FF8B
    
    
    Picture of the IAR Options:



    How does Code Composer do it?
    Thanks,
    -Jim
  • Let me answer my own question: This is how you do it in CCS

    #pragma RETAIN(JTAG_signatures)
    #pragma DATA_SECTION(JTAG_signatures, ".jtagsignature")
    const uint16_t JTAG_signatures[] = {0xAAAA, 0x0004};
    

    #pragma RETAIN(JTAG_password)
    #pragma DATA_SECTION(JTAG_password, ".jtagpassword")
    const uint8_t JTAG_password[] = {0xEF, 0xCD, 0xAB, 0x89, 0x67, 0x45, 0x23, 0x01};
    //JTAG PW: 0xcdef89ab45670123
    
    Put the JTAG PW in:



  • Harish Singh said:

    In my other customised board with MSP430FR2155, I am not being able to lock the JTAG with password. So that I can update the firmware using that password protection later.

    You can lock JTAG access, but password for this device for firmware update (erase all and write new content)  is irrelevant, because using boot code in combination with mailbox system by SBW / JTAG interface, device can be mass erased back to factory (fuse unlocked) state.

**Attention** This is a public forum