How to setup MSP430 Launchpad in ubuntu

 

 

 

 

 

 

 

 

This will help you to set up MSP430 Launchpad in ubuntu…TI provides support only for windows.we will setup the toolchain,debugger and test ablink led c program.

First install the dependencies needed

$sudo apt-get install git-core gcc-4.4 texinfo patch libncurses5-dev
$ sudo apt-get install zlibc zlib1g-dev libx11-dev libusb-dev libreadline6-dev

Now download mspgcc compiler

git clone git://mspgcc4.git.sourceforge.net/gitroot/mspgcc4/mspgcc4
cd mspgcc4
sudo sh buildgcc.sh

The build script will ask a number of questions.  Accept the default by pressing Enter for each question except “Do you want to start build right now?”  The proper response here is of course “yes”!

Download and install mspdebug the debugger

cd ..
git clone git://mspdebug.git.sourceforge.net/gitroot/mspdebug/mspdebug
cd mspdebug
make
sudo make install

Now make a blink.c program

/* Demo app to blink the red LED on the TI Launchpad */
#include <msp430x24x.h>
int main(void) {
 volatile int i;
// stop watchdog timer
 WDTCTL = WDTPW | WDTHOLD;
 // set up bit 0 of P1 as output
 P2DIR = 0x01;
 // intialize bit 0 of P1 to 0
 P2OUT = 0x00;
// loop forever
 for (;;) {
 // toggle bit 0 of P1
 P2OUT ^= 0x01;
 // delay for a while
 for (i = 0; i < 0x6000; i++);
 }
}

Now compile it

$ /opt/msp430-gcc-4.4.5/bin/msp430-gcc -oS -o blink.elf blink.c

Now we generated the elf or executable.use mspdebug to download the program to the board

$ sudo mspdebug rf2500
(mspdebug) prog blink.elf
Erasing...
Programming...
Writing 104 bytes to fc00...
Writing  32 bytes to ffe0...
(mspdebug) run
Running. Press Ctrl+C to interrupt...

The red LED will be blinking right now…

Advertisements

4 thoughts on “How to setup MSP430 Launchpad in ubuntu

  1. Hm,
    sudo sh buildgcc.sh
    gives me

    Do you want to start build right now? (y/n) [n] y
    Running sh do-binutils.sh “/opt/msp430-gcc-4.4.5” “2.21” “http://ftp.uni-kl.de” “build”
    –2012-07-04 21:01:00– http://ftp.uni-kl.de/pub/gnu/binutils/binutils-2.21.tar.bz2
    Auflösen des Hostnamen »ftp.uni-kl.de (ftp.uni-kl.de)«… 131.246.123.4, 2001:638:208:ef1b:0:ff:fe00:4
    Verbindungsaufbau zu http://ftp.uni-kl.de (ftp.uni-kl.de)|131.246.123.4|:80… verbunden.
    HTTP-Anforderung gesendet, warte auf Antwort… 404 Not Found
    2012-07-04 21:01:00 FEHLER 404: Not Found.

    The binutils version in buildbcc.pl (which buildgcc.sh says should be called) has to be changed to 2.21.1.

    But now I get a

    checking for gcc… no
    checking for cc… no
    checking for cl.exe… no
    configure: error: in `/home/pixel/launchpad/mspgcc4/build/binutils-2.21.1-build’:
    configure: error: no acceptable C compiler found in $PATH
    See `config.log’ for more details.
    sh do-binutils.sh “/opt/msp430-gcc-4.4.5” “2.21.1” “http://ftp.uni-kl.de” “build” exited with status code 1.
    Failed to execute sh do-binutils.sh “/opt/msp430-gcc-4.4.5” “2.21.1” “http://ftp.uni-kl.de” “build” at ./buildgcc.pl line 248, line 9.

  2. Hi there, great instructions, everything went very smoothly except that in compiling, the msp43-gcc-4.4.5 directory is completely empty, so the compile command does not work. Any ideas on what may have gone wrong?Thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s