Monday, October 15, 2012

Firts steps to work with msp430 launchpad on linux


Installing linux on pendrive.


This example will be based on ubuntu 12.04 linux distribution. You can choose from every distributions that derive from it like LUBUNTU or MINT. Ubuntu distribution can be installed with preservance space on pendrive so you can keep changing data beetwen reboots.

http://unetbootin.sourceforge.net/

- download binary for yours operating system ( can be windows:)
- run and choose distribiton: Lubuntu version 12.04 live
- specify amount of space to preserve files across reboot ( 1GB min )
- after succesful installation boot your new linux system from pendrive:)

Install compiler, binutlis, c library for msp430.

sudo apt-get install binutils-msp430 gcc-msp430 msp430-libc

binutlis-msp430  - utlis like assembler, linker, objdump
gcc-msp430 - compiler
msp430-libc - standard C library

For newer version or if you distribution doesn't have packages you can compile it for yourself using Energia build script or download precompiled binaries from https://github.com/energia/Energia/downloads

wget https://github.com/downloads/energia/Energia/energia-0101E0008-linux.tgz
tar -zxvf energia-0101E0008-linux.tgz energia-0101E0008/hardware/tools/msp430
sudo mv energia-0101E0008/hardware/tools/msp430 /opt/
sudo apt-get install libgmp3c2 libmpfr4 libmpc2
If your system doesn't have libgmp3c2 in repository install manually:
wget http://ubuntu.mirror.cambrium.nl/ubuntu//pool/main/g/gmp/libgmp3c2_4.2.2+dfsg-1ubuntu2_i386.deb
sudo dpkg -i libgmp3c2_4.2.2+dfsg-1ubuntu2_i386.deb
rm -rf energia-0101E0008 energia-0101E0008-linux.tgz

Add this line to your ~/.bashrc file: 
"export PATH=$PATH:/opt/msp430/bin" 
so we can execute programs from this path. 
Open new terminal window and type:
msp430-gcc 
You should see:
msp430-gcc: fatal error: no input files
compilation terminated.
This is ok:D

Compile debuger and programmer for msp430 mspdebug.

Download from: http://mspdebug.sourceforge.net/download.html

cd ~/Download
wget http://sourceforge.net/projects/mspdebug/files/mspdebug-0.20.tar.gz
sudo apt-get install make libusb-dev
tar -xvzf mspdebug-0.20.tar.gz
cd mspdebug-0.20
make WITHOUT_READLINE=1
sudo make install

Connect launchpad to usb port and issue this command:

sudo mspdebug rf2500

If everything went ok you should see prompt (mspdebug) 

Now we have everything we need to write our first program on launchpad.

No comments:

Post a Comment