Čeština / English

Documents / Installation of MSP430-GCC under Linux

Author: Zdeněk Vašíček ()

1. Official tutorial

MSP430-GCC can be installed using the instructions provided on the MSP430-GCC project website. This procedure should be working in any distribution, but it involves to install older GCC toolchain (gcc-3.4).

After installation, please check the system variable PATH (see step 5 of the following instructions).

2. Patched sources for GCC 4.x

If you do not want to install GCC 3.4, you can download patched source code from the download section and follow these instructions. We recommend not to change the installation prefix in order to avoide problems and crashes caused the bugs in the configure script.

  1. Extract archive containing binutils (assembler, linker), gcc, and libc.

    mkdir MSP-GCC && cd MSP-GCC
    tar -xzf ../msp430gcc-patched.tgz
  2. First, compile binutils

    cd MSP-GCC/binutils-2.18
    ./configure --target=msp430 --prefix=/opt/mspgcc \
                --disable-nls --disable-shared --enable-debug --disable-threads \
                --with-gcc --with-gnu-as --with-gnu-ld --with-stabs \
    sudo make install
  3. Then, compile GCC toolchain

    export PATH=/opt/mspgcc/bin:$PATH
    cd MSP-GCC/gcc-3.2.3
    ./configure --target=msp430 --prefix=/opt/mspgcc \
                --disable-multilib --disable-libc --disable-libssp \
                --disable-intl --disable-libiberty \
                --with-gcc --with-gnu-ld --with-gnu-as --with-stabs \
                --disable-shared --disable-threads --disable-win32-registry --disable-nls \
    sudo make install
  4. Finally, it is necessary to compile libc library

    cd MSP-GCC/msp430-libc/src
    sudo make install

    If you have installed GCC and binutils in a different directory than the one given in this manual, it is necessary to modify prefix = /opt/mspgcc variable located in the msp430-libc/src/Makefile before you will compile libc library.

  5. Do not forget to append the tools to the PATH system variable.

    echo "export PATH=/opt/mspgcc/bin:\$PATH" >> ~/.bashrc

    To apply the changes, you have to re-login.

This steps were verified using GCC 4.3.2

3. Installation from packages

If you don't want to compile the MSP430-GCC from sources, it is possible to use the precompiled package for your distribution (msp430-devtools). The steps how to install the package are desribed in this document.

Visited: 3516x Last visit: 28.11.2022 11:43:15