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.

MSP430F6726: DFU via BLE UART

Part Number: MSP430F6726

Hi,

I've the MSP and BLE module connected over UART with hardware flow control and few other indagators like connection status and advertising status. The MSP talk's with BLE via (a) sort of user defined AT commands(I have full freedom to write code in BLE module(nRF52840)). I use BLE custom characteristics services for BLE communications. Currently the flash memory of MSP is divided into 2 blocks and starts with block 0 to do DFU I write the firmware data to block 1 and change the starting sequence to block 1 after verifying the data. If I wann to do new update now the new firmware data is written to block 0 and starting address is changed to block 0. The DFU works with android and iOS app just by uploading ti_main.txt(hex) file. Everything works fine with this method, the only downside is on any case 50% of flash is unused(Just left as a backup for old firmware).  

I've been going through BSL approach and found msp430f6726 is capable of flash BSL, custom BSL and MSP Boot. But all this method speaks RST, TEST, TX, RX to some default pins and BSL Script which runs on Windows/Linux/MAC.  And bit confused how to use it over BLE UART. 

As my current application utilise more then 50% of my flash I can't able to use this old method for DFU. Can some one recommend me an alternative solution for this.

  • Hi Sivashankar,

    Not sure if you have already seen these documents.  They may provide some guidance.  I'll ask around to see if anyone on our team may have some thoughts.

    https://www.ti.com/lit/an/slaa511a/slaa511a.pdf

    https://www.ti.com/lit/an/slaa721e/slaa721e.pdf

  • Hi Dennis,

    Thanks for sharing those, on a very first look, Both of this documents considering MSP430FRxxx as reference. Would it be good to follow the same with msp430f6726.

    Thanks,

    Sivashankar

  • Hi Sivashankar,

    Ok, if I understand your setup, the BLE radio interfaces to the MSP430 with UART.  To program the MSP430, The BLE device would need to connect to the additional pins,  RST and TEST.  The RST and TEST pins are used to put the MSP430 into BSL mode (this is called the hardware entry method).  The BLE would need to following the BSL commands described in section 3 (protocol) in the document  SLAA319 Flash Devices Bootloader.

    Does this help?

  • Hi Dennis,

    Before getting into BLE connection I start with BSL 1st. I've connected the Reset and Test pin to arduino to toogle MSP into BSL mode, and it's working  with a BSA_ACK in BSL_uart  so now all good and I'm set to go.

    I wrote a python script to construct BSL commends https://1drv.ms/u/s!ArCbXDYx3yjAgU70bq-dflpNhiAh?e=2aiuOU

    @4000
    81 00 00 3C B1 13 30 00 0C 43 B1 13 00 00 1C 43 
    B1 13 2A 00 32 D0 10 00 FD 3F 03 43 
    @ffd0
    14 40 14 40 14 40 14 40 14 40 14 40 14 40 14 40 
    14 40 14 40 14 40 14 40 14 40 14 40 14 40 14 40 
    14 40 14 40 14 40 14 40 14 40 14 40 14 40 00 40 
    F1 03 B2 40 80 5A 5C 01 D2 D3 04 02 D2 E3 02 02 
    B1 40 40 42 00 00 81 93 00 00 F8 27 91 83 00 00 
    81 93 00 00 F3 27 FA 3F 03 43 03 43 FF 3F 03 43 
    1C 43 10 01 
    q
    Sample blink led program in led.txt

    filelike = open("led.txt")
    data = load(filelike)
    #version cheack
    con_data_write(BSL_VERSION, b'')
    #mass errase
    con_data_write(BSL_MASS_ERASE, b'')
    #send password
    con_data_write(BSL_RX_PASSWORD, b'\xff' * 32)
    #version cheack
    con_data_write(BSL_VERSION, b'')
    for n in range(len(data)):
    if len(data.segments[n].data) & 1:
    print("Yes appending!", len(data.segments[n].data))
    data.segments[n].data += '\xff'
    block = bytearray(three_bytes(data.segments[n].startaddress).encode()) + data.segments[n].data
    con_data_write(BSL_RX_DATA_BLOCK, block)

    ***detailed code is given here https://1drv.ms/u/s!ArCbXDYx3yjAgU70bq-dflpNhiAh?e=2aiuOU ****

    #Debud output
    8 <class 'bytes'> b'\x00\x80\x02\x00;\x04\xe4\x84' 008002003b04e484 (Version) 8 <class 'bytes'> b'\x00\x80\x02\x00;\x00`\xc4' 008002003b0060c4 (Mass Erase) 8 <class 'bytes'> b'\x00\x80\x02\x00;\x00`\xc4' 008002003b0060c4 (Password) 11 <class 'bytes'> b'\x00\x80\x05\x00:\x00\x07\x05\x04\xada' 008005003a00070504ad61 (Version after unlock) 8 <class 'bytes'> b'\x00\x80\x02\x00;\x00`\xc4' 008002003b0060c4 (Block @4000 write) 8 <class 'bytes'> b'\x00\x80\x02\x00;\x01A\xd4' 008002003b0141d4 (Block @ffd0)

    at block ffd0 I'm getting crc error, I'm not sure why? If my crc calc function is wrong how come other commands are working.
    If my crc calc is working what's going wrong with ffd0 block

    I'm using ccs 10 with Hex utility output format options Output TI-Txt hex format.
  • Hi Sivashankar,

    I spent some time digging into this and to be honest, based on what you are provided, I don't know why the BSL is returning a CRC error on that block of data.

    Can you provide a .map and the linker command file .cmd for this project?

  • Hi Dennis,

    I had the same confusion, But luckily I got it working, using BSLScripter-3.4.0.2. I believe the python BSL package is developed with python2 and I was using Python3 so I was facing lot's issues. 

    Ref:

    software-dl.ti.com/.../index_FDS.html

  • Hi Sivashankar,

    I'm relieved you figured out a solution.

    Since it looks like you were able to resolve your issue, I'll change the status of this posting to RESOLVED.
    If this isn’t the case, please click the "This did NOT resolve my issue" button and reply to this thread with more information.
    If this thread locks, please click the "Ask a related question" button and in the new thread describe the current status of your issue and any additional details you may have to assist us in helping to solve your issues.

**Attention** This is a public forum