Building MSP430-GCC From Sources

From Texas Instruments Wiki
Jump to: navigation, search

Introduction

This page is a placeholder for building MSP430 GCC toolchain. Rebuilding GCC is necessary if patches or the bleeding edge is required to be built.

Required Tools

This document assumes that the required tools are installed on the system and that they are available on the system path.

  • GNU make
  • GCC and binutils
  • bzip2 and tar

Building MSP430 GCC

The building steps for Linux, Windows, and Mac are similar to each other.

  1. Download and extract the MSP430 GCC sources from TI website.
  2. export: Export all needed variables
  3. mkdir build: Create a build directory
  4. cd build: change to build directory
  5. ../sources/tools/configure: Configure the entire GCC sources directory before the build. See the corresponding options for every build below.
  6. make all: Compile the entire program.
  7. make install: Copy the executables, libraries, and so on to the file names where they should reside for actual use.
  8. make info: Generate Compile Info files.
  9. make install-info: Generate install Info files.

Building MSP430 GCC on Linux

% wget http://softwaredl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/latest/exports/msp430-gccsource.tar.bz2
% tar xvjf msp430-gcc-source.tar.bz2?tracked=1
% mkdir build
% cd build
% ../sources/tools/configure --prefix=/path/to/install_location --target=msp430-elf --enable_languages=c,c++
% make all
% make install
% make info
% make install-info

Building MSP430 GCC on Windows (Cross Compiled on Linux)

% wget http://softwaredl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/latest/exports/msp430-gccsource.tar.bz2
% tar xvjf msp430-gcc-source.tar.bz2?tracked=1
% yum install mingw32-gcc mingw32-gcc-g++
  Configm win32 gcc:
  % ls -1 /usr/bin/*gcc
  /usr/bin/gcc
  /usr/bin/i386-redhat-linux-gcc
  /usr/bin/i686-pc-mingw32-gcc
% export PATH=/path/to/install_location/bin:$PATH
% mkdir build
% cd build

From above yum install, the "i686-pc-mingw32" matches --host below. You must have a pre-built msp430-elf native toolchain in your $PATH:
     
% ../sources/tools/configure --prefix=/path/to/install_location --target=msp430-elf --enable-languages=c,c++ --host=i686-pc-mingw32 --disable-itcl --disable-tk --disabletcl --disable-libgui --disable-gdbtk
% make all
% make install
% make info
% make install-info

Building MSP430 GCC on OS X

% wget http://softwaredl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/latest/exports/msp430-gccsource.tar.bz2
% tar xvjf msp430-gcc-source.tar.bz2?tracked=1
% export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
% export LIBRARY_PATH=/usr/X11/lib
% export MACOSX_DEPLOYMENT_TARGET=10.5
% mkdir build% cd build% ../sources/tools/configure --target=msp430-elf --prefix=/path/to/install_location --enable-languages=c,c++ --disable-werror --disableitcl --disable-tk --disable-tcl --disable-libgui --disable-gdbtk --disable-sim
% make all
% make install
% make info
% make install-info

Building MSP430 GCC Stand-Alone Full Package

  1. MSP430 GCC Compiler
    1. Download the MSP430 GCC Installer Compiler only from MSP430 GCC Folder
    2. Use the generated MSP430 GCC version
  2. USB driver package (Windows only)
    1. Download "Stand-alone Driver Installer for USB Low-Level Drivers" from MSP Debug Stack
  3. MSPDS OS package
    1. Download "MSP Debug Stack Open Source Package" from MSP Debug Stack
  4. Build MSPDebugStack
    1. Extract "MSP Debug Stack Open Source Package"
    2. Follow the instructions in "README-BUILD.txt"
  5. GDB agent
    1. Download the GDB agent from XDS Emulation Software_Package
  6. MSP430 support files for GCC
    1. Download "msp430-gcc-support-files.zip" from MSP430 GCC Folder