This tutorial will show you how to set up a develop environment for the MSP430 launchpad on Ubuntu.
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:
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
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:
You should see the device signature of 0451:f432. Note that this is also called the “ez430 Development Tool”.
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.
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.
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:
Thanks, and happy building.