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.

MSP430FR2311: Question about MSP430FR2311 security

Part Number: MSP430FR2311
Other Parts Discussed in Thread: MSP430FR5969, MSP-FET

Hi Team,

In many devices that I used early I could protect code memory from reading, but if I perform erase operation, it erase also firmware and protection bit.

It is not clear to me, if I can do it in MSP430FR2311.

If I disable BSL and lock JTAG/SBW, can I totally erase firmware and reprogram?

Please advice.

I am afraid to damage device.

Thanks,

Shlomi

  • Hi Shlomi
    If you locked the BSL and sent a wrong password to access the BSLd the device will mass erase itself.
    For more information you can refer to www.ti.com/.../slau550p.pdf Page28
  • Hi Gary,

    It is not so helpful. I need to erase using MSP430.dll API. Is it possible?

    I see configuration parameter TOTAL_ERASE_DEVICE. But it is not clear how to use it.

     

    If device is protected by BSL Password as mentioned in 1.11 of device user guide (Device security)

    1. How can I define length of password? It is in fixed addresses (FFE0h to FFFFh). But shall I use all space for password?
    2. If device is password protected how can I access this device using MSP430.dll?

     MSP430_OpenDevice()

    STATUS_T WINAPI MSP430_OpenDevice

    (

    const char * 

    Device,

    const char * 

    Password,

    int32_t 

    PwLength,

    int32_t 

    DeviceCode,

    int32_t 

    setId 

    )

    Should be here the same password as BSL password

    1. What happen when BSL Signature FF84h to FF87h is 0xFFFF as default?

    I really need support here because all this is not clear enough.

    Thanks,

    Shlomi

  • Hi Shlomi

    We have the code protection user's guide and example code at: www.ti.com/.../slaa685.pdf
  • Hi Gary,

    It looks very interesting and may be solve my problems but some questions:
    1. Example in this document related to MSP430FR5969. I use MSP430FR2311. Can I be sure that MSP430FR2311 supports these features. Not in datasheet and not in user guide of that MSP430FR2311 there is nothing about addresses 0xFF80 and 0xFF8.
    2. If after burning from IAR with password I need to access JTAG from MSP430.dll, shall I use the same password in function MSP430_OpenDevice of MSP430.dll
    3. If I do not use BSL and disable it, is it ok, for procedure mentioned above?

    Best regards,
    Shlomi
  • Hi Gary,
    I attempted to do it but it does not work.
    Really please check if MSP430FR2311 supports JTAG password.
    And if yes, how to do it.
    Best regards,
    Shlomi
  • Hi Shlomi

    1. The MSP430FR2311 don't support the JTAG access with password feature. In fr2311 you can use the GUI FET-Pro-430-LITE(www.elprotronic.com/products to blow fuse to disable the JTAG. If you want to reuse the device you can ues the bsl to execute the mass erase. For the use of the bls you can refer to www.ti.com/.../slau655f.pdf
  • But BSL needs or UART or I2C or SPI. All these ports are busy. Is any way via JTAG to cause BSL to erase memory?
  • Hi Shlomi

    If the JTAG is not disable before you can use the GUI FET-Pro-430-LITE to erase memory,but if you have disabled the JTAG before, I am afraid there is no solution to erase memory by JTAG.
  • I also think so. In this case I have to add some part in my firmware that do it according to external signal. If no another way I will do it.
    Can firmware itself write to address of JTAG? Will it enable it after reset?
  • Hi Shlomi
    Yes you can use firmware to disable the JTAG. Just add the code below can be work
    #pragma RETAIN(JTAG_signatures)
    #pragma DATA_SECTION(JTAG_signatures, ".jtagsignature")
    const uint16_t JTAG_signatures[] = {0xAAAA, 0x0002};
  • My question was not about disable. I asked about enable.
    For example JTAG is disabled.
    But I have a GPIO that normally pull up.
    And if on its input is 0, my firmware erase itself and write FF to all JTAG fuses.
    Will it enable JTAG in next power up?
  • Hi Shlomi

    I have a solution for you here:

    You can use a button to re-enable the JTAG, but you should keep the power on until you down load a new code to the device with the JTAG.

    Here is the code you can refer to(I use fr2311).

    msp430fr231x_P1_01.c
    /* --COPYRIGHT--,BSD_EX
     * Copyright (c) 2014, Texas Instruments Incorporated
     * All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     * *  Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     * *  Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the distribution.
     *
     * *  Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     *
     *******************************************************************************
     *
     *                       MSP430 CODE EXAMPLE DISCLAIMER
     *
     * MSP430 code examples are self-contained low-level programs that typically
     * demonstrate a single peripheral function or device feature in a highly
     * concise manner. For this the code may rely on the device's power-on default
     * register values and settings such as the clock configuration and care must
     * be taken when combining code from several examples to avoid potential side
     * effects. Also see www.ti.com/grace for a GUI- and www.ti.com/msp430ware
     * for an API functional library-approach to peripheral configuration.
     *
     * --/COPYRIGHT--*/
    //******************************************************************************
    //  MSP430FR413x Demo - Software Poll P1.3, Set P1.0 if P1.3 = 1
    //
    //  Description: Poll P1.3 in a loop. Set P1.0 if P1.3 = 1, or reset P1.0.
    //               By default, FR413x select XT1 as FLL reference.
    //               If XT1 is present, the XIN and XOUT pin needs to be configured.
    //               If XT1 is absent, REFO is automatically switched for FLL
    //               reference.
    //               XT1 is considered to be absent.
    //  ACLK = default REFO ~32768Hz, MCLK = SMCLK = default DCODIV ~1MHz.
    //
    //              MSP430FR4133
    //            ---------------
    //        /|\|               |
    //         | |               |
    //         --|RST            |
    //     /|\   |               |
    //      --o--|P1.3       P1.0|-->LED
    //     \|/   |               |
    //           |               |
    //
    //   Darren Lu
    //   Texas Instruments Inc.
    //   July 2015
    //   Built with IAR Embedded Workbench v6.30 & Code Composer Studio v6.1 
    //******************************************************************************
    
    #include <msp430.h>
    #include<stdint.h>
    
    #pragma RETAIN(JTAG_signatures)
    #pragma DATA_SECTION(JTAG_signatures, ".jtagsignature")
     uint16_t JTAG_signatures[] = {0xAAAA, 0x0002};
    
    void main(void)
    {
        WDTCTL = WDTPW | WDTHOLD;               // Stop watchdog timer
    
        P1OUT &= ~BIT0;                         // Clear P1.0 output latch for a defined power-on state
        P1DIR |= BIT0;                          // Set P1.0 to output direction
        P1OUT |= BIT1;
        P1DIR &= ~BIT1;                         // Set P1.3 as input
        P1REN|=BIT1;
    
        PM5CTL0 &= ~LOCKLPM5;                   // Disable the GPIO power-on default high-impedance mode
        SYSCFG0=FRWPPW|0x0000;                                  // to activate previously configured port settings
     //   SYSCFG0&=0xff00;
        JTAG_signatures[0]= 0xaaaa;
        JTAG_signatures[1]= 0xaaaa;
    
        SYSCFG0=FRWPPW|0x03;
    
        while (1)                               // Test P1.3
        {
            if (P1IN & BIT1)
                P1OUT |= BIT0;                  // if P1.3 set, set P1.0
            else
            {
                P1OUT &=~BIT0;                      // Toggle P1.0 using exclusive-OR
                SYSCFG0=FRWPPW|0x0000;                                  // to activate previously configured port settings
    
                JTAG_signatures[0]= 0xffff;
                JTAG_signatures[1]= 0xffff;
                SYSCFG0=FRWPPW|0x03;
    
            }
    
            __delay_cycles(100000);
        }
    }
    
    

  • Hi Gary,

    I have already implemented similar code but problem that I will need additional equipment.

    I want to try to use additional signals of MSP FETFlash.

    I read in SLAU647L documentation that furthermore to JTAG/SWD  there is a UART  interface with CTS, RTS signals.

    Can I control them as usual UART or via MSPDebugStack?

    Is any way to access it when JTAG is opened via MSP430.dll?

    Any code examples?

    In SLAU647L is it not clear enough

    Best regards,

    Shlomi

     

  • Hi Shlomi

    Yes, you can use the UART to lock or unlock the JTAG .You can use a flag in FRAM memory to control whether to lock the JTAG.
    There is no code examples here.But that sounds interesting, thank you for your idea.

    Gary
  • Hi Gary,

    I need to uses UART in MSP FET Flash

    I try to configure it setting baud rates as mentioned in table and after that control RTS pint (13).

    I try to work with is as usual com port in windows.

    For example I set baud rate  9622 to configure using hand shake.

    After that I set it to 9600 and try to control RTS output using Windows SetCommState function. But nothing changed.

    What may be wrong? Is it a way to control this UART.

    Or there is another dll to it?

    Please help.

    Best regards,

    Shlomi

    MSP.docx

  • Hi Gary,
    Please read my questions carefully!!!

    It is not related to JTAG.

    My questions about MSP-FET Backchannel UART


    I read in SLAU647L documentation that furthermore to JTAG/SWD there is a UART interface with CTS, RTS signals of Backchannel UART

    Can I control them as usual UART or via MSPDebugStack?
    Is any way to access it when JTAG is opened via MSP430.dll?
    Any code examples?
    In SLAU647L it is not clear enough.

    Best regards,
    Shlomi
  • Hi Shlomi

    So you just want to use UART on the eZ-FET to communicate with PC? If so you can use the UART code example in the resource explorer.

  • Hi Gary,

    Where is it? Is it a part of IAR, or I can download it?

    Thanks,

    Shlomi

  • It is in CCS, you can also find the UART example code in the msp2311' sdk: www.ti.com/.../getliterature.tsp
  • It again looks that you does not understand what I asked.
    I ask how to control Backchannel UART of MSP FET Flash and not controller UART. How to control UART in MSP430FR2311 I know and do it without problems.
    I want to use it according to mentioned in In SLAU647L but it does not work.
    It looks that you familiar only MSP430FR2311, can you point me to someone that know how to control MSP FET FLash.
  • Hi Shlomi

    I have help you to ask the question with the tools team, but there is no reply from that side. I can give you an email address of the tools team you can ask them directly. Berenbrinker, Florian <f-berenbrinker@ti.com> . And I will close this thread.

    Best regards
    Gary

**Attention** This is a public forum