mspgcc extends the GNU toolchain to support the TI MSP430 microcontroller.
mspgcc can be used as the development environment for these platforms:
|
We thank Chris Snyder for his contribution to setting up this environment.
The mspgcc toolchain supports both the SCons/command line environment and Eclipse.
The GNU toolchain includes several component packages, listed in the table below. The listed versions are known to work.
Package | Version | Notes |
---|---|---|
gcc-msp430 | (GCC) 4.6.3 20120301 | 'msp430-gcc' in Fedora |
binutils-msp430 | (GNU Binutils) 2.21.1 | 'msp430-binutils' in Fedora |
msp430-libc | 20120224 | |
msp430 mcu | 20120406 | |
mspdebug | 0.19-1 | Supports debugging via hardware such as MSPFET-430uif. |
There are two ways to install the toolchain components: from the distribution packages listed above, or from the source code itself via the links below. We have tested with Ubuntu 12.04LTS 64bit.
Source code links:
mspgcc
packages for mingw
. mingw
is a "minimalist GNU for Windows", i.e. it contains the build tools you typically find in a Linux distribution, but runs on Windows.mspgcc-20120406-p20120911.zip
.C:\mspgcc\mspgcc-20120406-p20120911
.bin/
directory to your PATH
. Use one of the following:To add it temporarily, open a command prompt and type
C:\Users\Thomas>set PATH=%PATH%;C:\mspgcc\mspgcc-20120406-p20120911\bin\ |
Ctrl+Windows
.Advanced System Settings
> Environment Variables
.User Variables for <you>
, select PATH
and click Edit
.Variable Value
text field, append;C:\mspgcc\mspgcc-20120406-p20120911\bin\
.The build environment transparently executes the necessary software to load firmware onto motes. For reference, OpenWSN uses these tools under the covers:
bootload
key, for example bootload=/dev/ttyUSB0
.Your MSP-FET430 UIF can come with different versions of the firmware. If you connect your FET debugger to the USB port and appears as a /dev/ttyUSBx devices then most probably you have version 2 of the firmware. If contrarily it appears as a /dev/ttyACMx your device is on version 3 of the firmware.
With version 2 of the firmware things are pretty easy.
def uploader(device): return Builder(action = 'mspdebug -d {} -j uif "prog $SOURCE"'.format(device), suffix = '.phonyupload', src_suffix = '.ihex') |
scons project=<gina|telosb|pc> upload=/dev/ttyUSBx ./path/to/project/03oos_openwsn/ e.g: scons project=gina upload=/dev/ttyUSB0 ./firmware/openos/projects/common/03oos_openwsn/ |
If you have version 3 of the firmware you have 2 options:
Needed to say that I had a lot of problems to setup that. I will try to simplify as much as possible the steps to follow so you skip all my problems.
def uploader(device): return Builder(action = 'mspdebug tilib -d {} "prog $SOURCE"'.format(device), suffix = '.phonyupload', src_suffix = '.ihex') |
scons project=<gina|telosb|pc> upload=/dev/ttyACMx ./path/to/project/03oos_openwsn/ e.g: scons project=gina upload=/dev/ttyACM0 ./firmware/openos/projects/common/03oos_openwsn/ |
If libmsp430.so library does not work, you will need to compile it manually. To do so you can follow this tutorial and this very helpful post on the TI forums. Besides I try to resume here all the steps.:
./boostrap.sh --prefix=[dir] ./b2 link=static cxxflags=-fPIC -d+2 -a |
scons project=<gina|telosb|pc> upload=/dev/ttyACMx ./path/to/project/03oos_openwsn/ e.g: scons project=gina upload=/dev/ttyACM0 ./firmware/openos/projects/common/03oos_openwsn/ |
During the process of setting up the environment I've found this problems. Check this section in case you are facing any problem during the install.
Problem: When installing msp430-binutils from sources the compiler complaints about makeinfo in the texinfo package.
Solution: Install texinfo from sources:
apt-get install texinfo.
Then edit the Makefile (line 344) and replace
MAKEINFO = /path/to/your/msp430-build/binutils-2.21.1/missing makeinfo by: MAKEINFO = makeinfo |
Problem: GDB does not compile and complaints about ncurses lib.
Solution: Install libcurses5-dev
apt-get install libncurses5-dev
Problem: mspdebug does not compile because usb.h and readline.h header are missing
Solution: Install libus-dev and libreadline-dev
apt-get install libusb-dev
apt-get install libreadline libreadline-dev