Jeffrey's Log

Archives | Subscribe


Running MSP430F5529 Launchpad using GNU/Linux


I own an MSP430F5529 USB launchpad from Texas Instruments. Cheap in cost, this launchpad is a good resource for developing your USB applications. It has an open source onboard debugger eZ-FET lite.

For developing applications for MSP430, there is already a well maintained C toolchain(gcc-msp430) available. On an Ubuntu/Debian machine, you can install it using the below command
sudo apt-get install gcc-msp430 msp430-libc msp430mcu

For debugging purpose, I am using mspdebug. But I had some hard time in setting up this debugger on my GNU/Linux machine. Due to some driver issues, the default mspdebug package from Ubuntu repository didn’t work. To get it working, there are some extra packages provided by TI to be installed.

Another alternative was to get the pre-compiled mspdebug from Energia. Energia comes with all these issues solved. But if you want to try the hard way, refer this.

Below steps describe how to use mspdebug from Energia
1) Download Energia for GNU/Linux from http://energia.nu/download/
2) Extract the tgz file. I got a folder named energia-0101E0011. The number in the folder name might change for you depending on the energia version you are using.
3) Go into the folder energia-0101E0011/hardware/tools/msp430/bin/ using the cd command.
3) Copy libmsp430.so to /usr/lib/
4) Update the firmware of the debugger using sudo ./mspdebug tilib --allow-fw-update
5) Now you can run mspdebug using the following command sudo ./mspdebug tilib

If you were successful, you will get the mspdebug console
(mspdebug)

Now lets write a small code and see if we can flash it to the launchpad.

Save the below code as blink.c

#include <msp430.h>

main()
{
  unsigned int i = 0;
  P1DIR = 1;

  while(1)
  {
    P1OUT = 1;
    for (i=0; i < 65535; i++);
    P1OUT = 0;
    for (i=0; i < 65535; i++);
  }
}

Lets compile this software using the below command
msp430-gcc -mmcu=msp430f5529 -mdisable-watchdog blink.c

We need to flash the output of the above compilation to the launchpad. Launch mspdebug using sudo ./mspdebug tilib. Then run
(mspdebug) prog a.out
Note: Since mspdebug is inside the energia folder and this blink.c file is at another location, when using the prog command in mspdebug, you have to give the path to the a.out file i.e
(mspdebug) prog /path/to/the/file/a.out

Now the LED on the launchpad will start to blink!
MSP430F5529 blinking LED

Posted in: Electronics, MSP430 | Tagged under: , | 2 Comments

One Comment

  1. Hugh Sutherland MonsterID Icon Hugh Sutherland
    Posted January 19, 2015 at 7:39 AM | Permalink

    Thank you! What a time saver.

    One note for any other users as clue-less as I am. If you download the linux64 flavor of Energia, libmsp430.so should be copied to /usr/lib64.

One Trackback

  1. By Multitask scheduler for MSP430F5529 launchpad on June 2, 2014 at 8:00 AM

    […] NOTE: If you want to program your MSP430F5529 launchpad using GNU/Linux, read my previous post – Running MSP430F5529 Launchpad using GNU/Linux […]