|mspgcc: A port of the GNU tools to the Texas Instruments MSP430 microcontrollers|
|<<< Previous||Building mspgcc from source code|
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
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
$ 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
$ 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
$ 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 can now test the installed tools. Try building an example program, as follows:
$ msp430-gcc -mmcu=msp430x148 -o test -O test.c
$ msp430-objdump -DS test
$ 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.