Programming the MSP430 Launchpad on Ubuntu

This entry is part 2 of 2 in the series MSP430 Launchpad Tutorial  

This tutorial will show you how to set up a develop environment for the MSP430 launchpad on Ubuntu.

The MSP430 Launchpad comes in a kit containing 2 MCU's, 2 sets of female headers, A microUSB cable, a micro Crystal, and a couple of logo stickers.
The MSP430 Launchpad comes in a kit containing 2 MCU’s, 2 sets of female headers, A microUSB cable, a micro Crystal, and a couple of logo stickers.

 

One of the prerequisites for a suitable microcontroller for my hobby projects is that it must be compatible with linux.  In particular, Ubuntu.  As usual, it was up to the linux community to make this happen.  Thankfully there are some great projects out there that have created some excellent open source options.  Even better, this software is available through the Ubuntu repository.

I was able to get up and running/programming in minutes using the following steps:

Install the required packages

For basic memory flashing and programming, you will only need to install 4 new packages:

  • binutils-msp430
  • gcc-msp430
  • msp430-libc
  • mspdebug

To install these packages, enter the following at the command prompt in your terminal:
sudo apt-get install binutils-msp430 gcc-msp430 msp430-libc mspdebug

getting_msp430_packages

Connect the MSP430 Launchpad using the included microUSB cable

After connecting the launchpad, you should see a green LED indicating that it is powered up and ready to go.  Check that your launchpad is listed as a USB device by entering the following at the command prompt:

lsusb

lsusb-msp430

You should see the device signature of 0451:f432.  Note that this is also called the “ez430 Development Tool”.

Run mspdebug

The next step is to test a few commands with mspdebug.  This is the program that will allow us to erase and program the launchpad.   To test connectivity and to make sure everything is working correctly, issue the following at the command prompt:

sudo mspdebug rf2500

The rf2500 in this case is to let mspdebug know that you are programming a chip from the ez430 series.  For a whole list of options with mspdebug, view the manpage: man mspdebug

One good way to test it out is to issue the following command at the mspdebug prompt:

md 0xf800 2048

This will read 2KB from section 0xf800 on the device and display it as a hexdump.  I’m not entirely sure what all that means except that it is actually reading the device and everything seems to be communicating OK.

md_command

The next thing to test out is erasing the memory.  At the mspdebug prompt, enter the erase command.  Don’t you love how intuitive that one is?  After this command, you can run the read command from above and see that the memory is indeed blank.

read_after_erasing

At this point you should have all the required tools for debugging and programming the msp430 launchpad on Ubuntu.  I’ll be covering more on compiling and loading real programming examples in the next article in this series.

As a side note, TI and Redhat have teamed up to bring the development environment into a more mainstreapm software package.  This may eventually make these steps obsolete:
http://www.mail-archive.com/mspgcc-users@lists.sourceforge.net/msg11305.html

Thanks, and happy building.

Series Navigation<< Fun With the MSP430 Launchpad

13 Comments


  1. hi,

    thanks for posting. Other posts on this topic are on older ubuntu versions. may be they are relevant but i don’t get confidence following steps of older I got a bug and was not able to move further than detecting msp launchpad on usb port using lsusb. i have tried the solutions on net but am still wondering what’s wrong… I got the following error:

    sudo mspdebug rf2500
    MSPDebug version 0.21 – debugging tool for MSP430 MCUs
    Copyright (C) 2009-2012 Daniel Beer
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    Trying to open interface 1 on 005
    Initializing FET…
    FET protocol version is 30001000
    Set Vcc: 3000 mV
    Configured for Spy-Bi-Wire
    fet: FET returned error code 4 (Could not find device or device not supported)
    fet: command C_IDENT1 failed
    fet: identify failed
    Trying again…
    Initializing FET…
    FET protocol version is 30001000
    Set Vcc: 3000 mV
    Configured for Spy-Bi-Wire
    Sending reset…
    fet: FET returned error code 4 (Could not find device or device not supported)
    fet: command C_IDENT1 failed
    fet: identify failed

    could you provide some cues as to what might be wrong. some link where i might find solution

    Reply

    1. Hi Anurag, Are you using the MSP430 launchpad? The rf2500 argument indicates you are connecting to a Launchpad or Chronos device according to the mspdebug manpage: http://manpages.ubuntu.com/manpages/precise/man1/mspdebug.1.html.

      One thing you may want to try is to specify the device or try different driver arguments such as:
      sudo mspdebug rf2500 -d /dev/ttyUSB0
      or
      sudo mspdebug uif -d /dev/ttyUSB0

      Reply

      1. Hi Erik,
        I ran into same situation and my energia is also having the same issue i.e. not seeing the launch pad.

        Reply

  2. thanks for the reply Erik. Yes, I am using the MSP-EXP430G2 (launchpad). I did try all the options with mspdebug. But to no avail. I even tried running the kit using windows but couldn’t. I checked dll files, drivers, CCS settings and other options like mspFlasher.exe and spent hours troubleshooting. didn’t work. But thanks to TI for making the kit so cheap. I got a new one today and it works just fine. Still I will try to make the old one work and if I have some progress, will post here. The threads on TI on troubleshooting this kit are not that useful.

    Reply

    1. anurag,
      kya aap nay apne launch pad ka firmwear version change karne ki koshis ki thi aur aap nay isay beech par rok diya tha yadi han to launchpad ko change kar do,
      kharab ho gaya hai.
      maine bhi kar aisa kiya tha

      Reply

    2. There is not much to troubleshoot, if you can’t get it hooked to computer – that part is wired electronics.

      Reply

  3. I have been trying all morning to get some kind of environment for the MSP-EXP430G2 launch pad on Ubuntu 10.04 LTS the above sudo apt-get install binutils-msp430 gcc-msp430 msp430-libc mspdebug gives me the error:
    E: Couldn’t find package binutils-msp430
    so is there still a way to use the launchpad with linux or am I wasting my time??

    Reply

    1. 10.04 LTS was released back in 2009, well before TI Launchpads were. Even then, manual build of reguired tools is very likely to succeed on machine this older.

      Reply


Leave a Reply

Your email address will not be published. Required fields are marked *