[Sergio Campamá] wrote in to tell us he’s assembled a guide for compiling the latest release of MSPGCC. This is a cross-compiling tool chain for the popular MSP430 line of microncontrollers. We used a version available from the Ubuntu repositories when developing with the TI Launchpad and the eZ430-F2013.
Installing from repositories is easy, but you don’t get the newest features and often newer hardware isn’t supported. [Sergio] reports that the newest version, called Uniarch, pulls source code and header files from the middle of this month and supports over 300 devices. In fact, it specifically outlines the goal of making new hardware easier to incorporate than with previous versions. He’s tailored this guide specifically for Ubuntu but while we were wading through a Google search we also found a page that outlines compilation for OSX.
We didn’t really notice before, but GitHub sure does make those README.md files look nice when viewed on the web, doesn’t it?
I’m using the GCC4 version (mspgcc4) which is a fork / port of this, and it’s still pretty up-to-date. No problems so far.
I understand that Uniarch is supposed to be a stepping stone to getting the regular mspgcc on GCC4 as well, among other things.
The header files for all of the devices in both release seem to be the same ones that TI includes in Code Composer Studio, so my experience so far is that it’s pretty easy to take code from CCS and use it on mspgcc.
I’m not an experienced MSP430 programmer, but so far I really like the hardware and the opensource support is actually really good. Even some die-hard Arduino fans might enjoy working with this platform.
Quite frankly, this is why Arduino is so popular. I have setup GCC compile chains before (as a Mac user) but that effort is off-putting to casual experimentation with other micro-controller families.
I am considering the MPS430 for a very low power application but haven’t yet found the time and energy to deal with the effort described here.
On the other hand, choosing the Microchip PIC32 family for another design over an ARM device was made easier by the chipKIT.
This is why I love Arch.
http://aur.archlinux.org/packages.php?ID=30132
been using it for a while now.
@DanJ Uh no, this isn’t why Arduino is popular. This hassle is only if you want to run the open source tools. I think most people will use the TI’s ide, although thats got a 16KB limit.
vtl, there’s no reason for that sort of attitude here. DanJ’s point is completely valid; Windows users with the TI tools are limited to 16kB unless they pay, and Mac and Linux users are left to use the gcc toolchain, which can be difficult to set up.
Compare that to the Arduino, which comes with a fully supported cross-platform IDE. Why is it so hard to believe that people use the Arduino because it’s easy to get started?
In all honestly, I’ve had more trouble with my Arduino than the MSP430. One of the demo programs hosed my board because of a firmware defect in the USB interface. It took some fighting to get it working correctly (forced a program load before the demo program kicked on), and then I updated the firmware on the USB chip to fix the problem (after a lot of searching to find a forum thread detailing the issue). And the avr-gcc software on Linux is just about as much work to install as the MSP430’s.
And I’m still not sure what the big deal is on the 16KB limit in CCS, considering that none of the MSP430 Value Line chips are larger than 16KB flash.
If you’re building larger projects than that, then you either:
A. Have the money for CCS since you are writing software for a higher-end uC.
B. Can use GCC and take the 10 minutes it requires to instal msp430gcc and plug it into Eclipse.
http://www.43oh.com/2010/11/a-step-by-step-guide-msp430-programming-under-linux/
@vtl TI’s IDE is crippled rubbish. Arduino is popular because it’s easy. Even the UI of the Arduino IDE is clean, simple and easy.
Unfortunately that’s also why people KEEP using it when it’s unnecessary or a third-choice solution for a given problem. When the only tool you have is a hammer, everything starts to look like a nail.
@Bob
I could never, ever, get the Arduino IDE to work. First I had to go fish out a compatible librxtx because the bundled one was for 32 bit systems. Once that was taken care of, the next choosing the place to save the “sketches”. I had to edit the configuration file by hand for it to work. Then it was painful adding my own libraries. Then the “sketches” wouldn’t save as you would expect them to, something that made me lose my work a couple of times.
The solution was simple:
Dump the IDE.
Dump their libraries [some of which are buggy anyway and don’t work properly].
Install Eclipse + avr-eclipse. Do your work in good ol’ fashioned C with gcc-avr and avr-libc.
With MSPs now, I don’t even use Eclipse. I installed the toolchain out of AUR, wrote my own makefile and voila, just invoke make and call it a day.
#sample makefile for a launchpad board.
CC := msp430-gcc
PROGRAMMER := mspdebug
MMCU := msp430g2231
CFLAGS := -O2 -std=gnu99 -Wall
DRIVER := rf2500
PROG := prog
SIZE := msp430-size
.PHONY: all debug build clean prog
all: core.o build size
debug: core.d build size
build:
@echo -n Linking…
@$(CC) -o core.elf core.o
@echo -e done.’\n’
clean:
@echo -n Removing files…
-@rm -f core.elf core.o
@echo -e done.’\n’
prog: all program
progd: debug program
@echo Starting gdb server…
@$(PROGRAMMER) $(DRIVER) gdb
size:
@$(SIZE) core.elf
program:
@echo Programming device…
@$(PROGRAMMER) $(DRIVER) “$(PROG) core.elf”
echo -e — done. ‘\n’
core.o: core.c
@echo Compiling… core.c
@$(CC) -c $(CFLAGS) -mmcu=$(MMCU) core.c
@echo -e — done.’\n’
core.d: core.c
@echo Compiling with debug infos… core.c
@$(CC) -c $(CFLAGS) -g -mmcu=$(MMCU) core.c
@echo -e — done.’\n’
At least for the chips that the Launchpad supports, TI’s “crippled” development system is just fine – its limitation is the amount of memory you can use, and none of the chips have that much memory anyway. For the more powerful versions of the MSP430 it could be an issue, but I assume the development tools that come with the new FRAM dev board have higher limits.
@Bill
The new FRAM board also has 16KB (of FRAM), so it will fit into the limitations of CCS v4 (Code limited version).
The code limited version of CCS only includes compilers for MSP430 (16KB) and CS28x (32KB limit). Other than that, my understanding is that it is just as capable as the standard version minus DSP/Bios.
And honestly… If it’s crippled, I didn’t have any problems with it. I tried it on a Windows machine without issue, but at home I still just use GCC and Eclipse on my Linux box.
I see no point in compiling everything from scratch, when the toolchain is already packaged and available from repos:
* https://launchpad.net/ubuntu/oneiric/+search?text=msp430
* http://packages.debian.org/search?keywords=msp430&searchon=names&suite=testing§ion=all
I just received my FRAM exp board and was wondering about compilers.
Why would one use a diffrent compiler then the TI IDE? and what is MSPGCC? I have been reading about it but im not sure why I would use it.
Well, I wrote the guide to be as simple as possible, while still getting the latest release, with all the improvements. I believe that mspgcc4 is kinda outdated now, because development for it stopped.
As Alex said, this is the only thing left for us with linux and mac, as TI only develops de IDE for windows. My goal with the guide was to simplify the setup to get a working mspgcc quickly, and in my opinion it does just that.
The other thing is that mspgcc can compile to almost ANY msp430 device out there now, without limitations. And with mspdebug allowing any programmer, you don’t really need IAR or CCS.
I actually hate Eclipse, or everything Java, so what I do now for developing on my mac is to have a virtual machine running Ubuntu server (VERY fast), and connect to it using ssh and afp (netatalk on the other side) to mount the ubuntu virtual disk. That way I have the comfort of developing in XCode or TextMate, while keeping my mac clean from beta binaries. And if I ever get ubuntu screwed up, I just revert to it to a working state with VMWare’s snapshots.
The other thing I despise is Make. So in the Launchpad repo where the guide is hosted, in https://github.com/sergiocampama/Launchpad , I have a Rakefile designed to compile any project to any device with mspgcc, and install to the device with mspdebug, real simple. With the command ‘rake build install’ in 5 seconds you have your project compiled and running on the micro. It could be easily edited to support other programmers…
Check the repo I just mentioned, it has some simple working examples for the Launchpad, clone, rake build install, and it’s working.
People are saying the TI ide is crippled? You gotta be kidding me. The arduino ide is junk. Its just a text editor with a compile button and serial monitor!
Yes sure the TI ide has a 16KB code limit and they are tightarses for doing that. But you can’t actually encounter that limit with the launchapd unless you go ahead and solder a QFN or QFP to a breadboard and wire up a bigger chip. None of their PDIP chips are greater than 16kb.
But the feature set is still miles ahead of the Arduino IDE; you get to single step your code, peek and change the core registers. This debugging alone makes it worth using the 16kb limit.
Ok I understand that open source makes everyone warm and fuzzy but people have to accept that propreitry tool can be useful too.
@vtl
I’ll admit IAR and CCS are useful for people starting development, and the limit is ok for that purpose. But how can you justify the price when there’s a free version and really easy to use? And I’m not talking about the Launchpad only, it’s free for every chip, at any size.
For those OS X users:
http://osx-launchpad.blogspot.com/2010/11/launchpads-toolchain-version-20101112.html
This is an installer to give you the complete package and it worked perfectly on my Snow Leopard (10.6.6) install.
I don’t suppose anyone has used this with the FRAM Experimenters Board? I know mspdebug doesn’t support it yet.