MSP430F5529 Launchpad

From HW wiki
Jump to: navigation, search

What it is

Official webpage

Linux command-line flashing tools


To program the device, one can use Energia, Code Composer Studio or some other integrated IDE. We would like to avoid using such IDEs, thus we need to make the flashing and compilation work from the command-line.

The following notes describe the process of building tools required for flashing on Ubuntu 13.10, x86_64 system. Readers discretion is advised.

First steps

To be able to flash the msp430f5529 present on the Launchpad, it is necessary to compile the mspdebug and the so called msp430.DLLv3 library (including hidapi).

The msp430.DLLv3 library provided by the TI is not only used to communicate with the programmer present on the board, but also to upgrade the firmware inside the programmer.

More info: [1] [2] [3]

The first step is to install necessary libraries and compilers (for later use).

sudo apt-get install gcc-msp430 gdb-msp430 msp430-libc msp430mcu
sudo apt-get install libboost-all-dev
sudo apt-get install libusb-dev libreadline-dev libusb-1.0-0-dev libudev-dev


MSP_Debug_Stack MSPDS_Open_Source_Package


cd MSPDebugStack_OS_Package/
# read README-BUILD.txt

Jump to the section describing hidapi compilation. Compile it, copy to the ThirdParty folder and continue ...


If there is an error saying "FILE" does not correspond to any known datatype, open the file causing the error and add line

#include <stdio.h>

Either copy the freshly compiled library to /usr/local/lib or always call export LD_LIBRARY_PATH= ... before running mspdebug


sudo apt-get install libudev-dev libusb-1.0-0-dev libfox-1.6-dev
sudo apt-get install autotools-dev autoconf automake libtool
git clone git://

cd hidapi
git checkout hidapi-0.7.0 #This particular version is required for 'MSP430.DLLv3.3.1.4 Open Source version -- Released 10/02/2013'
cd linux

modify Makefile

diff --git a/linux/Makefile b/linux/Makefile
index 338bbd3..f88344b 100644
--- a/linux/Makefile
+++ b/linux/Makefile
@@ -9,15 +9,15 @@
 all: hidtest
 CC       ?= gcc
-CFLAGS   ?= -Wall -g
+CFLAGS   ?= -Wall -g -fPIC
 CXX      ?= g++
-CXXFLAGS ?= -Wall -g
+CXXFLAGS ?= -Wall -g -fPIC
 COBJS     = hid-libusb.o
 CPPOBJS   = ../hidtest/hidtest.o
 OBJS      = $(COBJS) $(CPPOBJS)
-LIBS      = `pkg-config libusb-1.0 libudev --libs`
+LIBS      = `pkg-config libusb-1.0 libudev --libs` -lpthread
 INCLUDES ?= -I../hidapi `pkg-config libusb-1.0 --cflags`

Continue ...

copy hid-libusb.o to MSPDebugStack_OS_Package/Thirdparty/lib
     and hiapi.h to MSPDebugStack_OS_Package/Thirdparty/include


git clone git:// mspdebug


make install

Using the mspdebug

vim /etc/group #Add user to dialout

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

# if there is no ttyACM, you can use something like
mspdebug -U 0451:2046 tilib

# Flash a binary to the MCU
mspdebug tilib "prog main.elf"