Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

...

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:

  • GINA
  • GINA-Basestation
  • TelosB

gcc is the ubiquitous open-source C compiler. mspgcc is its extension to support the TI MSP430 micro-controller.

  We thank Chris Snyder for his contribution to setting up this environment.

Page Contents

Table of Contents
maxLevel2

...

  • Command line – See the sections below on mspgcc versions packages and installation.
  • Eclipse – See these separate pages:

Packages and Versions

We use the following versions in the OpenWSN team:

...

The GNU toolchain includes several component packages, listed in the table below. The listed versions are known to work.

PackageVersionNotes
gcc-msp430(GCC) 4.6.3 20120301
(mspgcc LTS 20120406 patched to 20120502)
'msp430-arGNU ar -gcc' in Fedora
binutils-msp430(GNU Binutils) 2.21.1
(mspgcc LTS 20120406 patched to 20120502)
'msp430-binutils' in Fedora
msp430-ranlibGNU ranlib (GNU Binutils) 2.21.1 (mspgcc LTS 20120406 patched to 20120502)

Installing

...

titleLinux...

The following steps were tested on Ubuntu 12.04LTS 64bit.

...

  1. [recommended] install the latest version of gcc-msp430 from source by following this tutorial.
  2. 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.

...

  1. [recommended] manual installation and compilation [download]
  2. There are packages Debian/Ubuntu and Fedora available:

    Code Block
    apt-get install mspdebug

...

  1. download the following firmware files [file1] [file2]
  2. place them into /lib/firmware.

...

libc20120224 
msp430mcu20120406
 
mspdebug0.19-1

Supports debugging via hardware such as MSPFET-430uif.
For Gina platform this hardware also is used for OpenWSN firmware upload.
If you don't need these tools, you don't need this package.

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

  1. Install the 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.
    1. Download the latest version from http://sourceforge.net/projects/mspgcc/files/Windows/mingw32/. At the time of writing, mspgcc-20120406-p20120911.zip.
    2. Unzip somewhere on your computer. We recommend C:\mspgcc\mspgcc-20120406-p20120911.
  2. Add the bin/ directory to your PATH. Use one of the following:
    1. To add it temporarily, open a command prompt and type

...


    1. Code Block
      C:\Users\Thomas>set PATH=%PATH%;C:\mspgcc\mspgcc-20120406-p20120911\bin\
    2. To add it permanently:
      1. Type Ctrl+Windows.
      2. Click on Advanced System Settings > Environment Variables.
      3. In User Variables for <you>, select PATH and click Edit.
      4. At the end of the Variable Value text field, append;C:\mspgcc\mspgcc-20120406-p20120911\bin\.

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 example  bootload=/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

...