mspgcc    | Home | Documentation | mspgcc Project page on SourceForge
MSPGCC
Subsections
Introduction
News
Documentation
Tools
FAQ
Contribute
Reporting bugs
Links
Wiki
 
Useful
BaudrateCalc
Assembler
 
Exits
MSP430@ti.com
GCC home
Binutils home
Python.org
Cygwin
 
Email Us
Webmaster

Dmitry Diky
Chris Liechti
 
 
© 2001-2009
  

Requirements

  • GCC sources: /releases/gcc-3.2/gcc-core-3.2.3.tar.bz2 (10MB). Use a mirror of your choice to download this file.
  • Binutils, a recent snapshot. The official distribution contains our MSP430 support: ftp://sources.redhat.com/pub/binutils/snapshots
  • optionaly GDB sources: gdb-5.1.1.tar.bz2 (FTP, 10.5MB)
    alternatively: GDB with integrated "Insight" GUI (recomended for win32/cygwin):
    insight-5.1.1.tar.bz2 (FTP, 15.5MB)
    (ony one of those two is needed)
  • The patches from this project. The lastest files can be checked out via Anonymous CVS. (empty password)
    cvs -d:pserver:anonymous@cvs.mspgcc.sourceforge.net:/cvsroot/mspgcc login
    cvs -z3 -d:pserver:anonymous@cvs.mspgcc.sourceforge.net:/cvsroot/mspgcc co gcc
    cvs -z3 -d:pserver:anonymous@cvs.mspgcc.sourceforge.net:/cvsroot/mspgcc co msp430-libc
    cvs -z3 -d:pserver:anonymous@cvs.mspgcc.sourceforge.net:/cvsroot/mspgcc co gdb
  • GCC host compiler (for Windows there is cygwin). Make sure you have the following tools:
    • GNU make
    • bzip2 & tar
    • binutils and gcc host installation
    Note: a Windows binary build is available in our downloads section: mspgcc-win32 downloads

CVS

Available tags on modules in the CVS repository:

  • binutils - release_1
  • gcc - release_1
  • msp430-libc - release_1
  • gdb - beta
We're trying to keep the sources in the CVS in a stable state at any time, so you can easily check out the HEAD version.

Build

Build instructions for Linux. On other systems you might need to write gmake instead of make. On cygwin leave the su away. You can also look here for an other description.

Enter the gray marked commands in a console window (e.g. BASH). You can unpack to you home directory and compile the tools as normal user, only the installation must be done as superuser.

First configure, build and install binutils:
tar --bzip2 -xf binutils-030503.tar.bz2 unpack the original GNU source tarball (you may also use the most recent snapshot instead of the one shown here)
cd binutils-030503 go to the binutils source tree
./configure --target=msp430 --prefix=/usr/local/msp430 configure as cross assembler
make build the tools, this will take several minutes
su login as superuser
make install install the cross tools on your system.

And when the binutils are ok continue to configure, build and install gcc. Make sure you've specified same --prefix and --target for both gcc and binutils, the msp430-binutils should be in the PATH:
tar --bzip2 -xf gcc-core-3.2.3.tar.bz2 unpack the original GNU source tarball
copy the files from this site in the sourcetree. You need to the the files from the gcc-3.3 directory of mspgcc (yes, that's right)
cd gcc-3.2.3 go to the gcc source tree
./configure --target=msp430 --prefix=/usr/local/msp430 configure as cross compiler
make build the tools, this will take several minutes
su login as superuser
make install install the cross compiler on your system.

Download msp430-libc and unpack it.
cd msp430-libc/src go to the libc sources.
Edit Makefile and specify correct prefix if you have specified, for binutils and gcc, something else than shown above. The default is /usr/local/msp430
make build, this will only take a minute or less
su login as superuser
make install.

Make sure you add $prefix/bin to the PATH in order to be able to invoke tools.

Now build and install gdb. This procedure works equaly for insight-5.1.1, just replace "gdb" with "insight" in the following steps. Make sure that you specify the same --prefix and --target as for gcc and binutils:
tar --bzip2 -xf gdb-5.1.1.tar.bz2 unpack the original GNU source tarball
copy the files from this site in the sourcetree.
cd gdb-5.1.1 go to the gdb source tree
./configure --target=msp430 --prefix=/usr/local/msp430 configure as cross compiler
make build the tools, this will take several minutes
su login as superuser
make install install the cross compiler on your system.

Now test the cross compiler:
msp430-gcc -mmcu=msp430x148 -o test -O test.c
Then you can produce, for example, disassembled text:
msp430-objdump -DS test
Or intel hex output:
msp430-objcopy -O ihex test test.ihex

All major gcc, as, ld options supported thought.