You are probably asking yourself which compiler for your launchpad/msp430, you should use. Me personally, I don’t really care which one works Better, I just need one to compile for my launchpad and supports the chips I use.
some similarities —
Both create files for your msp430 chip,
both are compiled with GCC 4.x+
Both use libc for the msp430.
They pretty much fill the same function.
Now some of the major differences, mspgcc4 is stable and can be used with production code, Uniarch is still being developed and is changing a lot still. mspgcc4 supports most of the chips for msp430 except the very newest (since it is hard to add newer chips with out rebuilding and adding a lot of code). Uniarch is trying to make adding chip support as easy as possible, and unifying all the branches of mspgcc. Even coding is slightly different, interrupts are coded different and even the headers you use may be different(FYI).
So which one should I choose?
Well that is a tough question, what are your goals?
are you trying to get one just up and running or do you need support for the newest chips? — Have you compiled programs from source or are you new to linux?
Will you give up after you get an error or will you work through it and figure it out?
Well if you need just something up and running just to be able to compile a few programs for your launch pad , I would suggest using mspgcc4 , using the build script or using the pre-built binaries. pre- built binaries, to install, you just add a folder to usr/local/ and call it mspgcc4 and unpack your binaries in there and that it. The build script is pretty self explanatory, and it compiles everything from source . I have used it multiple times and works as long as you have all the dependencies. IE(ncurses-dev, cvs, lidreadline-dev etc…)
A very simple way to get it up and running –
Now if you want access to the New uniarch mspgcc, that supports the new chips like msp430g2452 or others. you will need to go the long and hard route of patching compiling linking and more compiling lol. but there are some great directions to do it. Here (Thank you sergio). But it is not for the faint of heart….lol /JK
Now I had a few issues trying to compile and get it up and running, but I was not using the generic ubuntu build so I didn’t have access to some of the later packages. more or less I worked through it and all is well.
A few of my fixes
When I first started, trying to install all the dependencies(patch ncurses-dev build-essential bison flex libgmp3-dev libmpfr-dev libmpc-dev texinfo zlib1g-dev) , there was one I could not find –libmpc-dev.
lol So i continued anyways, knowing I didn’t have mpc installed. This will cause issues if you don’t have it, I learned that the hard-way. After continuing and building the tool chain(binutil) everything seemed fine, but it wasn’t, once you get to the gcc you will starting getting errors and you will be halted…….
with an error like
configure: error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+.
Try the –with-gmp, –with-mpfr and/or –with-mpc options to specify
their locations. Source code for these libraries can be found at
their respective hosting sites as well as at
ftp://gcc.gnu.org/pub/gcc/infrastructure/. See also
http://gcc.gnu.org/install/prerequisites.html for additional info. If
you obtained GMP, MPFR and/or MPC from a vendor distribution package,
make sure that you have installed both the libraries and the header
files. They may be located in separate packages.
so I did the thing most of you will do, install mpc gmp mpfr from source. This will not work —I tried multiple times and even tried using libtool to correct the issue , but to no avail……..next i tried using the options –with-gmp=/usr/local/include –with-mpfr=” ” –with-mpc= ‘ ‘
Still none of this worked………Then I remembered an old trick when I was building LFS(linux form scratch) Add the source code for mpc, gmp, mpfr to the gcc source code folder after you un-tar it. when gcc starts to build, it will look in its source folder for the files needed, just remember to change the folder name from let say gmp-0.9 to gmp.
This cleared the error and it finished building with out an issue. …… Now I wish someone would create a perl or python script to build and patch it like the mspgcc4 build script.
Updates to existing code, will be coming soon, these changes will reflect the newer uniarch mspgcc, on my site.
Refrence and links