...
...
...
...
...
mspgcc extends the GNU toolchain to support the TI MSP430 microcontroller.
Info |
---|
mspgcc can be used as the development environment for the following these platforms:
|
gcc is the ubiquitous open-source C compiler. mspgcc is its extension to support the TI MSP430 micro-controller.
Table of Contents |
---|
Versions
We use the following versions in the OpenWSN team:
...
We thank Chris Snyder for his contribution to setting up this environment.
Page Contents
Table of Contents | ||
---|---|---|
|
Build Environments
The mspgcc toolchain supports both the SCons/command line environment and Eclipse.
- Command line – See the sections below on mspgcc packages and installation.
- Eclipse – See these separate pages:
- With mspdebug (preferred)
- With mspgdb_proxy
Packages and Versions
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-arGNU ar -gcc' in Fedora | |
binutils-msp430 | (GNU Binutils) 2.21.1 | 'msp430-ranlib | GNU ranlib (GNU Binutils) 2.21.1 (mspgcc LTS 20120406 patched to 20120502) |
Installing
...
title | Linux... |
---|
The following steps were tested on Ubuntu 12.04LTS 64bit.
...
- [recommended] install the latest version of
gcc-msp430
from source by following this tutorial. - Use the version available in the sources of your distribution. At the time of writing, this is 1.5.3. While this version works, you will need to change interrupt declaration in the source code (i.e. in board.c) since #pragmas directives are not supported.
...
- [recommended] manual installation and compilation [download]
There are packages Debian/Ubuntu and Fedora available:
Code Block apt-get install mspdebug
...
...
binutils' in Fedora | ||
msp430-libc | 20120224 | |
msp430 mcu | 20120406 | |
mspdebug | 0.19-1 | Supports debugging via hardware such as MSPFET-430uif. |
Installation
Linux
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:
Windows
- Install the
mspgcc
packages formingw
.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.- Download the latest version from http://sourceforge.net/projects/mspgcc/files/Windows/mingw32/. At the time of writing,
mspgcc-20120406-p20120911.zip
. - Unzip somewhere on your computer. We recommend
C:\mspgcc\mspgcc-20120406-p20120911
.
- Download the latest version from http://sourceforge.net/projects/mspgcc/files/Windows/mingw32/. At the time of writing,
- Add the
bin/
directory to yourPATH
. Use one of the following:To add it temporarily, open a command prompt and type
...
Code Block C:\Users\Thomas>set PATH=%PATH%;C:\mspgcc\mspgcc-20120406-p20120911\bin\
- To add it permanently:
- Type
Ctrl+Windows
. - Click on
Advanced System Settings
>Environment Variables
. - In
User Variables for <you>
, selectPATH
and clickEdit
. - At the end of the
Variable Value
text field, append;C:\mspgcc\mspgcc-20120406-p20120911\bin\
.
- Type
...
To test that the installation was successfully, invoke the msp430-gcc
program with the --version
switch to have it print its version:
Code Block |
---|
C:\Users\Thomas>msp430-gcc --version
msp430-gcc (GCC) 4.6.3 20120301 (mspgcc LTS 20120406 patched to 20120502)
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
Building
The OpenWSN project uses SCons as its build environment. Refer to the Installation instructions for SCons.
For example, to build the 01bsp_bsp_timer
project for the TelosB platform, using mspgcc
, and loading the resulting binary on a TelosB connecting to COM30
of your computer, type:
...
Loading Firmware
The build environment transparently executes the necessary software to load firmware onto motes. For reference, OpenWSN uses these tools under the covers:
- TelosB – The MSP430 MCU includes a boostrap loader (BSL) program, and SCons includes the Python bsl command line tool to interact directly with the BSL program. Note: When using SCons to load firmware from Linux, use /dev entries for the
bootload
key, for examplebootload=/dev/ttyUSB0
.
Tips and Tricks
The MSP-FET430uif firmware
...
- install gcc-multilib library as you will need some extras from gcc: apt-get install gcc-multilib
- download the sources of the libmsp430.so library. I've put together the lib sources, a patch to correct errors on the library (only for 64bit version) and the firmware files for the FET. [download]
- unzip it and apply the patch to the folder.
- Then you will need to install libboost-*. Boost is a set of extension libraries for cpp and it is used by the libmsp430 library sources. download latest version (I used 1.5.2). Unzip it and execute:
Code Block |
---|
./boostrap.sh --prefix=[dir] ./b2 link=static cxxflags=-fPIC -d+2 -a |
...