| How to develop MSP430 Launchpad code on Linux |
|
|
|
|
The LaunchPad is an easy-to-use, affordable, and scalable introduction to the world of microcontrollers and the MSP430 family. The LaunchPad development kit is a part of TI's MSP430 Value Line series. It has an integrated DIP target socket that supports up to 20 pins, allowing MSP430 Value Line devices to be dropped into the LaunchPad board. Also, an on-board flash emulation tool allows direct interface to a PC for easy programming, debugging, and evaluation. Unfortunately, the TI supported tools for this kit are Windows only. It is, however, quite possible to use Linux based tools with Launchpad. The procedure below outlines the steps to build a Linux based tool chain and debugger, as well as create and test a short C program. The procedure below should work on either your x86 Linux machine or on an OMAP system using the GNOME image from this site. If you are using the GNOME image from this site all necessary packages to build the msp430 tools are included. If you are using an x86 machine you may need to install a few required packages (the below assumes you are using Ubuntu, modify as needed for your distro): $ sudo aptitude install git-core gcc-4.4 texinfo patch libncurses5-dev Next we will download and build the mspgcc compiler: git clone git://mspgcc4.git.sourceforge.net/gitroot/mspgcc4/mspgcc4 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"! Next we download and build mspdebug: cd .. At this point we're ready to test our first MSP430 program: blinking the red LED connected to the P1 pin. Create a blink.c file using your favorite editor: /* Demo app to blink the red LED on the TI Launchpad */ Next compile your program: $ /opt/msp430-gcc-4.4.5/bin/msp430-gcc -oS -o blink.elf blink.c Connect the Launchpad to your development machine using the supplied USB cable. Use MSPDebug to download and launch your program. $ sudo mspdebug rf2500 You should now see the red LED blinking! |
| Last Updated on Friday, 27 May 2011 08:21 |
gordon makes this comment
Monday, 23 May 2011
You need to declare i as being volatile for it to work as expected, so change
to
to have the desired effect.
sakoman makes this comment
Monday, 23 May 2011
Good point -- wasn't necessary when I ran the test. I suspect compiler quality has improved since I built it!
I've fixed the code in the article. Thanks!
arvindh makes this comment
Tuesday, 06 September 2011
i get an error while compiling,.. saying as
bash: /opt/msp430-gcc-4.4.5/bin/msp430-gcc: No such file or directory
when i moved to /opt/msp430-gcc-4.4.5 directory i found it completely empty,.
please can anybody help me
sakoman makes this comment
Friday, 09 September 2011
I suspect that you had an error and the compiler build failed. Try again to build the compiler and post any error messages.
Joao Pinto makes this comment
Monday, 14 November 2011
(...)
-------------------------------------
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"
--2011-11-14 13:48:29-- http://ftp.uni-kl.de/pub/gnu/binutils/binutils-2.21.tar.bz2
Resolving ftp.uni-kl.de... 131.246.123.4, 2001:638:208:ef1b:0:ff:fe00:4
Connecting to ftp.uni-kl.de|131.246.123.4|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2011-11-14 13:48:30 ERROR 404: Not Found.
sh do-binutils.sh "/opt/msp430-gcc-4.4.5" "2.21" "http://ftp.uni-kl.de" "build" exited with status code 8.
Failed to execute sh do-binutils.sh "/opt/msp430-gcc-4.4.5" "2.21" "http://ftp.uni-kl.de" "build" at ./buildgcc.pl line 248, line 9.
How can solve this? Has anyone found the same error?
Khaine makes this comment
Wednesday, 23 November 2011
TecKnight makes this comment
Tuesday, 31 January 2012
Change the line:
$BINUTILS_VERSION = "2.21";
to
$BINUTILS_VERSION = "2.22";