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.

MSP430F5438A: Update firmware image - using a .bin file retrieved from i2c and burned into flash memory

Part Number: MSP430F5438A

I have been given a tasks very similar to something I worked on about 20 years ago with an ARM7TDMI custom SoC with a small team of engineers.  This time I am running into an issue and need some guidance from the community.

(some background):

We have a product with an MSP430F5438A that needs to be updated out in the field.  The product is enclosed without JTAG or serial terminal connection.  Therefore, the design approach to update the firmware is to use i2c to send a new firmware image.  The product is the master and retrieves the size and CRC of the new .bin image from a slave device.  It then gets the image via i2c in sizeable chunks, fills RAM and burns the image from RAM to a 'scratchpad' area in Flash [repeatedly until done].  When the entire image is in Flash a CRC is performed to validate the image.  If the .bin image does NOT validate any reset will cause the MSP430 to reboot with the old 'original' image.  If the new image validates, a reset will cause the MSP430 to reboot with the new image.  To do this I believe I need to move the 'new' image from the 'scratchpad' area in flash to overwrite the old image.

I noticed in the documentation the BSL (bootloader) can use UART and I2C communication protocols (See SLAS655G - Section MAP MCU Programmer and Debugger page 101) has i2c capabilities, although I am not sure it could have been used in the design and making a design change now would not be possible.

Currently I am able to retrieve the new image over i2c, burn it into the 'scratchpad' area in flash, and perform the CRC.  Now I need a hand getting over the last hurdle on how to proceed.

Is it next move to simply overwrite the old image with the new image and reboot?  If so, I need some guidance, such as:  where to copy the new image so a 'reset' will boot with new image.

Any help would be appreciated,

Note:  Maybe there is an easier way somehow using the BSL and the new image located in flash - I am open to other approaches that won't completely change design intentions.

  • Factory TI UART BSL is stored inside 2 KByte BSL (protected by default) flash segments. It is open source (provided by TI) that can be modified / customized. If I remember right it is covered by slau319. I am not sure if there also I2C example exist for F5438. You can check also MSPBOOT that is not related to BSL. Anyway, everything is collected on this page...

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

    BTW, flashing is easier (and faster if block write is used) if flashing function is copied to RAM and executed from there.

**Attention** This is a public forum