MSP430/V3 firmware

This page exists to provide information on using the new TI open source MSP430.DLL library with MSPDebug. It's split into two sections:

slac460f/g/h Linux patches

Release F of MSP430.DLL adds a new library as a dependency (hidapi), which is not packaged on most distributions. When building on Windows, a batch file called install_thirdparty.bat fetches and builds the library.

The following patches, from Tamas Tevesz, adds an install_thirdparty.sh to the same effect as well as fixes build issues on Linux and other Unix-like systems:

A patch for release L has been provided by Alexei Colin:

This has been tested on Ubuntu 12.04 x86_64. Please ensure that you have the following dependencies installed before attempting to build (Debian/Ubuntu package names given below):

chipinfo.db

The file chipinfo.db, now included in MSPDebug, is generated from MSP430.DLL. The following patch adds rules for creating a binary called dumpdb which produces chipinfo.db as its output:

Updated for slac460g by Tamas Tevesz:

slac460a Linux patches (obsolete)

Note: the following patches correspond to an older release of the MSP430.DLL library.

This patch series modifies the MSP430.DLL source package from Texas Instruments so that it can be compiled and used on Linux systems.

To build, you will first need the following tools and libraries:

Obtain the archive (slac460.zip) from http://processors.wiki.ti.com/index.php/MSP_Debug_Stack.

Unpack and patch the sources:

unzip slac460.zip
tar xvfz /path/to/slac460-linux-patches-YYYYMMDD.tar.gz
cd MSP430.DLLv3_OS_Package
quilt push -a

Then build with "make". This will take a while, and you'll be left with a binary file named "libmsp430.so". You can either copy it to /usr/lib (or any other directory in your loader path) or specify the path of the containing directory by prepending the mspdebug command line with an appropriate value of LD_LIBRARY_PATH like so:

LD_LIBRARY_PATH=/path/to/MSP430.DLLv3_OS_Package mspdebug ...

After plugging in FET running V3 firmware, you should end up with a device file called /dev/ttyACM0 or similar. Connect to it as follows:

mspdebug tilib -d /dev/ttyACM0

Note that the library requires a matching version of firmware, and may need to update your FET firmware. By default, this won't happen, and you'll instead see an error message. If you need to update your FET firmware, use the following command-line option:

mspdebug tilib -d /dev/ttyACM0 --allow-fw-update

Note that you may see the following error when you run for the first time:

MSP430_Initialize: /dev/ttyACM0
firmware system error 8004

If this happens, just press Ctrl+\ to kill mspdebug and try again.

License for patches

Copyright 2011 Daniel Beer <>. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. 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.

THIS SOFTWARE IS PROVIDED BY ''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 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.

V3 FET firmware upgrade/downgrade

In order to use the new MSP430 library, your FET needs to be running V3 firmware. The following instructions outline a procedure for upgrading and downgrading the firmware using mspdebug. Before you start, you'll need the following:

The V3 firmware image provides a CDC-ACM class interface, whereas the V2 image appears as a generic TI3410 serial adapter. In the following instructions, it's assumed that devices running V2 firmware appear as /dev/ttyUSB0 and devices running V3 firmware appear as /dev/ttyACM0. You may have to adjust these names to suit your system.

Before you start, unpack the upgrade/downgrade program package. This package contains two TI Text files, which are referred to in the following instructions:

Upgrade procedure

First, it's recommended to read out a copy of your current firmware in case you need to downgrade again. This can be done using the uif-bsl driver:

$ mspdebug uif-bsl -d /dev/ttyUSB0 "hexout 0x2500 0xdb00 old-v2-firmware.hex"
MSPDebug version 0.18 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2011 Daniel Beer <dlbeer@gmail.com>
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Device ID: 0xf16c
BSL version is 1.61
Reading 4096 bytes from 0x2500...
Reading 4096 bytes from 0x3500...
Reading 4096 bytes from 0x4500...
Reading 4096 bytes from 0x5500...
Reading 4096 bytes from 0x6500...
Reading 4096 bytes from 0x7500...
Reading 4096 bytes from 0x8500...
Reading 4096 bytes from 0x9500...
Reading 4096 bytes from 0xa500...
Reading 4096 bytes from 0xb500...
Reading 4096 bytes from 0xc500...
Reading 4096 bytes from 0xd500...
Reading 4096 bytes from 0xe500...
Reading 2816 bytes from 0xf500...

Next, you need to upload the V3 upgrader image:

$ mspdebug/mspdebug uif-bsl -d /dev/ttyUSB0 "prog Uifv3Updater.txt"
MSPDebug version 0.18 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2011 Daniel Beer <dlbeer@gmail.com>
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Device ID: 0xf16c
BSL version is 1.61
Erasing...
Programming...
Writing 4096 bytes to 2500...
Writing 4096 bytes to 3500...
Writing 4096 bytes to 4500...
Writing 3374 bytes to 5500...
Writing    2 bytes to f7f0...
Writing    2 bytes to f7fe...
bsl: failed on command 0x3b (addr = 0x0000, len = 0x0000)

The final error is normal behaviour. At this point, your FET should reboot itself and reappear as /dev/ttyACM0. You're now ready to flash the latest library-matched firmware version:

$ mspdebug tilib -d /dev/ttyACM0 --allow-fw-update
MSPDebug version 0.18 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2011 Daniel Beer <dlbeer@gmail.com>
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

MSP430_Initialize: /dev/ttyACM0
FET firmware update is required.
Starting firmware update (this may take some time)...
Initializing bootloader...
Erasing firmware...
Programming new firmware...
Done, finishing...
Initializing bootloader...
Erasing firmware...
Programming new firmware...
     0 percent done
    25 percent done
    50 percent done
    75 percent done
   100 percent done
Done, finishing...
Update complete
MSP430_VCC: 3000 mV
VCC  in[mV]: 3000
VCC out[mV]: 2971
VCC out[mV]: 2994
MSP430_OpenDevice
num of devices 1
JtagID: 89
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
MSP430_GetFoundDevice
Device: MSP430F2274 (id = 0x001c)
2 breakpoints available
MSP430_EEM_Init

Available commands:
    =         delbreak  gdb       load      opt       reset     simio
    alias     dis       help      locka     prog      run       step
    break     erase     hexout    md        read      set       sym
    cgraph    exit      isearch   mw        regs      setbreak

Available options:
    color           gdb_loop        iradix
    fet_block_size  gdbc_xfer_size  quiet

Type "help <topic>" for more information.
Press Ctrl+D to quit.

(mspdebug)

If you get to this point, you're done -- you now have a fully functional V3 FET.

Downgrade procedure

If you have a V3 FET, and you want to return to using V2 firmware, you'll first need to ensure that you have a V2 firmware image ready to program. To start the procedure, you first need to flash and run the downgrader program on the V3 FET:

$ mspdebug tilib -d /dev/ttyACM0 --require-fw-update Uifv3Downgrader.txt
MSPDebug version 0.18 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2011 Daniel Beer <dlbeer@gmail.com>
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

MSP430_Initialize: /dev/ttyACM0
Updating firmware using Uifv3Downgrader.txt
Starting firmware update (this may take some time)...
Initializing bootloader...
Erasing firmware...
Programming new firmware...
     0 percent done
    50 percent done
   100 percent done
Done, finishing...

At this point, your FET may stop responding, and MSPDebug will hang. Kill it with either Ctrl+\, or by killing the process from another terminal. Replug the FET, and it should now appear as /dev/ttyUSB0. However, the LEDs won't light up, because there's no valid firmware image. Flash your old V2 firmware image using the uif-bsl driver:

$ mspdebug uif-bsl -d /dev/ttyUSB0 "prog old-v2-firmware.txt"
MSPDebug version 0.18 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2011 Daniel Beer <dlbeer@gmail.com>
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

bsl: couldn't read bootloader transition acknowledgement
bsl: warning: FET firmware not responding
Device ID: 0xf16c
BSL version is 1.61
Erasing...
Programming...
Writing 4096 bytes to 2500...
Writing 4096 bytes to 3500...
Writing 4096 bytes to 4500...
Writing 4096 bytes to 5500...
Writing 4096 bytes to 6500...
Writing 4096 bytes to 7500...
Writing 4096 bytes to 8500...
Writing 4096 bytes to 9500...
Writing 4096 bytes to a500...
Writing 4096 bytes to b500...
Writing 4096 bytes to c500...
Writing 4096 bytes to d500...
Writing 4096 bytes to e500...
Writing  304 bytes to f500...
Writing 1488 bytes to f7e0...
Writing   32 bytes to ffe0...

Note that there will be an initial delay while the driver attempts to wake up the non-existent FET firmware. After a few seconds, the warning message will appear and it'll proceed.

After this command, the FET will restart and the LEDs will come on. You should then be able to use it again as a V2 device via the uif driver.

Database dump patch

The patch linked above is to be applied to slac460f.zip. It causes a second binary, called "dumpdb", to be built. This binary dumps the chip database used by MSPDebug's fet3 driver.

You don't need this patch unless you're modifying MSPDebug in some way.