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.

MSP430FG6626: In-Application Programming

Part Number: MSP430FG6626
Other Parts Discussed in Thread: UNIFLASH, MSP-FET

I am developing my custom board where MSP430FG6626 is a SPI-slave mcu device of a master ARM-based cpu.

I will need to update the MSP430 firmware through the master cpu application code. I could develop my custom SPI-base bootloader, but why not to use BSL already available for MSP430 mcus? Unfortunately, till now I never used BSL for MSP430 devices programming; I know very little about it.

For that porpose, I routed all the UART BSL pins (RST/NMI/SBWTDIO, TEST/SBWTCK, P1.1 (BSLTX), P1.2 (BSLRX)) to the master cpu.

The MSP430FG6626 devices come preprogrammed with USB BSL, but my application does not plan to use USB functions. I see MSP430FG6626 devices may also be programmed with UART BSL in the BSL memory, replacing the factory-supplied USB BSL preprogrammed code.

My questions:

  1. Where do I find UART BSL firmware code for MSP430FG6626 devices?
  2. How do I program UART BSL on my MSP430FG6626 device? Is the Spy-Bi-Wire interface with MSP-FET430UIF and UniFlash tool enough?
  3. How do I check UART BSL for programming my MSP430FG6626 device? Do MSP-FET430UIF and UniFlash tool support BSL programming mode?
  4. Is there an application note or a demonstration code for an embedded BSL programmer C application to be used on my master cpu?
  5. What if I need to customize the UART BSL code? Is UART BSL source code available?

Thanks!

  •  I didn't check for long time, but I guess it must be somewhere here (for download)...

    https://www.ti.com/tool/MSPBSL

    If I remember right it was packed inside slau319.zip

    You can update new BSL to your device with any TI software / hardware tool, just BSL segment needs to be unlock first (similar to info A segment). Take care because JTAG fuse value is storel at the end of BSL area, and with locked JTAG and not working BSL, device is bricked forever.

    I don't remember document number, but tere is open source BSL master example where G2553 LP is used as BSL master, as interface between PC BSL scripter and target device.

    BSL source code is open source and can be customized. Maybe you will not find it exactly for your device, but it is covered with version for more similar devices.

    You can dump original one to have it on side. You can also search e2e, because I remember that it was mention many times how to do this, that you want.

  • Hello Zrno, thanks for your reply.

    I cannot find any slau319.zip, there is only the slau319ae_MSP430Tm Flash Devices Bootloader (BSL) document without any link to a firmware package.

    In the https://www.ti.com/tool/MSPBSL web page I see:

    • I can use OLIMEX MSP430-BSL Programmer or MSP-FET to program MSP430 flash through BSL. MSP-FET430UIF seems not to support BSL programming, right?
    • The only MSP430 BSL firmware to download seems to be in http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPBSL_CustomBSL430/latest/index_FDS.html , where I can get the latest MSP430 bootloader package for customizing purpose. Inside that package I find the last released BSL images (both USB and UART) for the MSP430FG662x family to be programmed starting from 0x1000 flash address.
    • In the MSP430 bootloader package which is the right firmware project for MSP430FG662x device to start customization from?
    • MSP430Tm Bootloader With SimpleLinkTm MCUs is the App note that provides the software to have embedded host for MSP430 bootloader: This looks like the demonstration code I asked about for an embedded MSP430 BSL host programmer, right?

    On MSP430FG662x device BSL flash memory starts from 0x1000 to 0x17FF.  The JTAG security lock key resides at the end of the BSL memory at addresses 0x17FC to 0x17FF.

    In order to not brick my MSP430FG662x device, is there a step-by-step guide for updating BSL firmware in a safe way?

  • Hi, 

    1.Correct.

    2. Please find table 5-27 in the document SLAU319 to get the correct version BSL code. 

    3. Yes. This is a demo code. You need modify it for FG662x. 

    4. Please try not to erase the lock key. Please double check the code. 

  • Hello Hawken, thanks for your reply.

    I'm going to use UniFlash to update BSL image in the BSL flash memory, but till now I never did that.

    Is UniFlash safe enough about the JTAG security lock key? How can it preserve the BSL 3 flash memory segment? Could you please tell me the right UniFlash settings to safely update BSL image?

  • Hi, 

    Anything from Uniflash cannot ensure the unlock stage. You should confirm the data. "The JTAG security lock key resides at the end of the bootloader (BSL) memory at addresses 17FCh through 17FFh. Anything other than 0h or FFFFFFFFh programmed to these addresses locks the JTAG interface" Uniflash can erase the 17FC to 17FF. It will not influnce the security. The BSL data you write will influnce the security. 

  • So, if I flash the released UART BSL image (BSL_00.08.08.04) into MSP430FG6626 BSL memory with UniFlash, erasing from 0x1000 to 0x17FF, I can be quite safe about the JTAG security, right?

    I see in the BSL_00.08.08.04.map file the JTAGLOCK_KEY segment is defined from 0x17FC to 0x17FF and in the BSL_00.08.08.04.txt file the last 4 bytes are all 0xFF, so the JTAG security is preserved as unlocked. right?

**Attention** This is a public forum