MSP430 LaunchPad Mac OS X

From Texas Instruments Wiki
Jump to: navigation, search

Installing the GCC4.x Toolchain under Mac OS X

In order to develop for the MSP430, you need a toolchain to compile your applications and a tool to upload firmware to your device.

Installing the toolchain manually

Visit the GCC 4.x toolchain for Texas Instruments MSP430 MCUs project page. Open a Terminal, cd to wherever you want to put the files, and do the following:

$ git clone git://mspgcc4.git.sourceforge.net/gitroot/mspgcc4/mspgcc4
$ cd mspgcc4 && perl buildgcc.pl

The mspgcc4 project has switched to Git instead of subversion to build.

You can accept the defaults for the questions it asks you (I chose "none" for Insight because it failed to compile on my Mac). On the last question (whether you want to start the build process), choose Y.

This will take a while depending on the speed of your computer, and you may be prompted for your password because buildgcc.sh needs to use sudo to install files into certain locations.

Installing mspdebug manually on top of MacPorts

Make sure you have MacPorts running on your system and install libusb and libelf:

$ sudo port install libusb
$ sudo port install libusb-compat
$ sudo port install libelf

You need to download mspdebug from here. I used git (sudo port install git-core) to download the latest and greatest:

$ git clone git://mspdebug.git.sourceforge.net/gitroot/mspdebug/mspdebug

Now you're ready to build mspdebug:

$ cd mspdebug
$ LDFLAGS=-L/opt/local/lib CFLAGS=-I/opt/local/include make

Installing the toolchain and mspdebug using Fink

Make sure you've setup Fink to use the packages from unstable and do a fink selfupdate. Then, you can install everything with:

$ fink install msp430-libc msp430-gdb mspdebug

Installing the toolchain with Homebrew

You can install llvm-msp430 (which includes msp430-gcc) and mspdebug with Homebrew.

You'll need to install Homebrew first.

The brew has not yet been accepted into the upstream Homebrew repository. To use them, you'll need to access my GitHub fork:

$ cd `brew --prefix`
$ git pull http://github.com/reid/homebrew.git

Then install the toolchain and mspdebug:

$ brew install mspdebug llvm-msp430

The build will probably take a half hour or more. If you try to use mspdebug, you'll get Permission denied errors until you prevent the HID drivers from interfering with the LaunchPad. The USB driver above doesn't work as-is, but the dummy driver provided by mspdebug does. See the "How do I get an RF2500/Launchpad working on OS/X?" section of the mspdebug FAQ for download and installation instructions.

You should then be able to connect to the LaunchPad with mspdebug:

$ mspdebug rf2500

See the sample project from Hack A Day's HOWTO for Launchpad programming on Linux for a simple program to compile and run on the LaunchPad. Note that you'll need to run make like this:

$ PATH=`brew --prefix llvm-msp430`/bin:$PATH make

The Makefile uses msp430-gcc. This works, but you can edit it to use clang by following the instructions on the llvm-msp430 project page.

USB Driver

These instructions probably won't work without TI's USB driver. TUSB3410 drivers for MAC OS X have not been officially released by TI, however unsupported, as-is drivers are available for evaluation use.

TUSB3410 Mac OS X Virtual COM Port Driver