Thursday, 3 April 2008

MSP430 Working on Linux with Eclipse

Wooahoooo,

So Getting this MSP430 to run on Linux with Eclipse is quite a bit of fun. Had a few hiccups and now am starting from scratch all over again. I wish there was a cool little eclipse installer for all this stuff....

Arrrgghhh!!! Its getting worse and worse....

OK, So I thought I would do my personalised little tutorial for Installing the MSPGCC Toolchain with Eclipse, running on Debian Etch for the ez430-F2013 Development Tool....

But first, I will give you some helpful links to pages which REALLY helped me get this going.

1. This guys Buildscript! Whoo, what a life saver. Thank you, thank you, thank you! http://vivara.net/software/mspgcc_build_script/

2. Thanks for this tutorial, although it is not 100% applicable to the ez430, it gives good details for the Eclipse setup. http://msp430.techcontent.net/eclipse.htm

4. This helped me getting the actual device running on Linux. http://people.ethz.ch/~npreyss/msp430/

5. Thanks Travis for the correct msp430-gdb commands to run (spy-bi-wire) in the init file!
http://travisgoodspeed.blogspot.com/2007/11/ti-ez430-in-linux-with-iar-kickstart.html

6. Thanks xGoat for having done this last year, and some little issues! http://xgoat.com/wp/tag/msp430/

7. Texinfo 4.8! Which is needed to install binutils 2.17. I had a more up to date version -4.11 which DOES NOT work somewhere in some makefile to compile the code. It has to do with some regex somewhere in the code. http://packages.debian.org/etch/i386/texinfo/download

8. The legend who actually codes some of the mspgcc files. He has an Eclipse MSP-GCC debugger extension (which I don't use, but it is cool anyway) http://homepage.hispeed.ch/py430/mspgcc/index.html

9. Some helpful mspgcc stuff although out of date... http://www.linuxjournal.com/article/8682

10. Nice pdf to get all steps working: http://www.scribd.com/doc/219845/msp430-mspgcc-eclipse-ubuntu-tutorial?ga_related_doc=1

OK,

So here goes, quick step-by-step.

1. Plug the ez430 device into a USB port. Then from a terminal window type:
dmesg

2. If everything is correctly installed, you should get something like the following and skip to step 4. else continue (You need to get something like the last line!!
usb 5-1: new full speed USB device using uhci_hcd and address 14
usb 5-1: configuration #1 chosen from 1 choice
ti_usb_3410_5052 5-1:1.0: TI USB 3410 1 port adapter converter detected
usb 5-1: reset full speed USB device using uhci_hcd and address 14
usb 5-1: device firmware changed
ti_usb_3410_5052: probe of 5-1:1.0 failed with error -5
usb 5-1: USB disconnect, address 14
usb 5-1: new full speed USB device using uhci_hcd and address 15
usb 5-1: configuration #1 chosen from 2 choices
ti_usb_3410_5052 5-1:1.0: TI USB 3410 1 port adapter converter detected
ti_usb_3410_5052: probe of 5-1:1.0 failed with error -5
ti_usb_3410_5052 5-1:2.0: TI USB 3410 1 port adapter converter detected
usb 5-1: TI USB 3410 1 port adapter converter now attached to ttyUSB1

3. Ok, you now need to follow the instructions from http://people.ethz.ch/~npreyss/msp430/ Which worked for me. If your kernel is slightly older, you might need to do some other things which I can not remember, but searching through some of the other links will render some solutions...

4. Ok, Hardware working, now its time to run the build script from http://vivara.net/software/mspgcc_build_script/ This script rocks, all you have to do is copy it into a user directory (ie /home/denzel/mspgcc) and run make (Ensure you have make installed- if not: apt-get install make). It will fetch the correct msp430 libraries and code,correct binutils 2.17, apply the patch to get the 2013 and 2012 mcu's working and install all the working binaries etc to the /usr/local/msp430 directory - You can change the msp430 directory in the top of the Makefile buildscript.

5. Ok, here is something that stumped me for a bit - although now I feel like a dumbass for not seeing it sooner. The buildscript might crash saying something about you not having Makeinfo, blah, blah, blah around the [info-recursive] make step. Check your texinfo version (texinfo --version)and if it is 4.11, you need to install the older 4.8 (download from the debian sources , and dpkg -i the .deb file). Run the script again, and it should compile!

6. Ok, You have the mspgcc files, the device working, now all you need is the Eclipse IDE, Eclipse CDT, and I used this plugin by Zylin (although I am not sure if it is required...). Go to the Eclipse website, download the latest version with the CDT. And download the Zylin plugin from http://www.zylin.com/embeddedcdt.html.Nice.

7. Setup Eclipse as per: http://msp430.techcontent.net/eclipse_tutor.htm. Ignoring the Windows Eclipse install screens....

8. The .gdbinit or .ini file that you use should contain the following instead though.
set remoteaddresssize 16
set remotetimeout 999999
target remote localhost:2000
monitor interface spy-bi-wire
monitor erase all
load Debug/THEProjectBINARY

You can see all the commands you can run from msp-gdb by typing help set .

9. uhhh... That should be about it. I hope the steps, although random give a good, ok, overview. Good luck and cheers! Doing things this way allows you to program for the 2012 and 2013 mcus! Woohhooo!!!

2 comments:

steve said...

you are such a nerd...

you would love ROTN: muizenbergs..Stephen Hawking is coming to my valley

Unknown said...

Great post, I've been digging though the latest source tarball of the mspgcc project trying to get it working right. This saved me a whole load of time.

Looks like some of the tools are in the wheezy repo now, though I'm a stickler for the new-stuff.

Thanks again.