The build procedure

The build instructions apply to Linux installations. You may need to modify them a little for other systems. For example, you might need to use "gmake" rather than "make". On Windows machines with Cygwin omit the "su" steps. You can unpack the code in your home directory, and compile the tools as a normal user. Only the installation need be performed as a superuser.

The files used to build the Windows installer, and Linux RPMs may be found in the "packaging" directory at the mspgcc web-site.

First configure, build and install binutils. The following commands will unpack the source code, configure binutils as a cross assembly package, build and install it:

$ tar --bzip2 -xf binutils-2.14.tar.bz2
$ cd binutils-2.14
$ ./configure --target=msp430 --prefix=/usr/local/msp430
$ make
$ su
$ make install
You may wish to change the prefix, to install the software in a directory other than "/usr/local/msp430". Common alternatives would be "/usr" or your home directory.

Next, ensure the directory in which you installed the binutils binary files is included in your "PATH" variable. The next stage will require the MSP430 binutils to be functional, when the MSP430 library is compiled.

Next, configure, build and install GCC. Make sure you specify the same "--prefix" and "--target" that you specified for binutils. Unpack the source code, as follows:

$ tar --bzip2 -xf gcc-core-3.2.3.tar.bz2
Copy the files from the "gcc/gcc-3.3" directory in the CVS repository at the mspgcc web-site into the unpacked GCC source tree. The mismatch between the numbering of GCC and this directory is an historical accident. You really do want the "gcc/gcc-3.3" to go with GCC version 3.2.3. To copy these files, and build and install GCC, use the following commands:
$ cp -a gcc/gcc-3.3/* gcc-3.2.3
$ cd gcc-3.2.3
$ ./configure --target=msp430 --prefix=/usr/local/msp430
$ make
$ su
$ make install

Download msp430-libc as either a tarball or from the CVS repository at the mspgcc web-site.

$ cd msp430-libc/src
If you specified something other than "/usr/local/msp430" as the prefix, when building binutils and GCC, you will need to edit the Makefile. Change "/usr/local/msp430" to the installation directory you are actually using. The use the following commands to build and install the library:
$ make
$ su
$ make install

Now build and install GDB. This procedure works equally well 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 binutils and GCC:

$ tar --bzip2 -xf gdb-5.1.1.tar.bz2
Copy the GDB files from the CVS repository at the mspgcc web-site into the unpacked GDB source tree. Now build and install GDB with the following commands:
$ cd gdb-5.1.1
$ ./configure --target=msp430 --prefix=/usr/local/msp430
$ make
$ su
$ make install

The source code for the generic gdbproxy program may be downloaded from the mspgcc web-site. However, the MSP430 specific source code is not available. If you want to use the generic source code for another project, you can. If you want to run msp430-gdbproxy you will need to download a binary version. msp430-gdbproxy requires a library - libHIL.so - to allow access to the parallel port. If there is a binary file for msp430-gdbproxy available for your machine, you should now build and install libHIL.so.

Copy the libHIL source code from the "jtag/hardware_access" directory in the CVS repository at the mspgcc web-site. Then, build and install it with the following commands:

$ cd jtag/hardware_access
$ make
$ su
$ mv libHIL.so /usr/local/lib
$ ldconfig
You could actually put the library almost anywhere, but make sure its directory is listed in your "LD_LIBRARY_PATH" environment variable.

You can now test the installed tools. Try building an example program, as follows:

$ msp430-gcc -mmcu=msp430x148 -o test -O test.c
You could then try producing disassembled text, with
$ msp430-objdump -DS test
Or you could generate Intel format hex output (e.g. for a programmer) with:
$ msp430-objcopy -O ihex test test.ihex

If you are able to use msp430-gdbproxy, and you have a JTAG FET tool (or one of the available compatible devices) you can try debugging a program in a target MSP430, using GDB and msp430-gdbproxy.

If all this works OK, you should now have a fully working mspgcc. We hope you enjoy using it. If you have any problems, try consulting the archives of the mailing lists at the mspgcc web-site. If that doesn't help, trying asking questions using the mailing list.