The lego account contains different tools for lego mindstorm (rcx and nxt)


  • Archive: packages for all
  • bin: various binarys, this includes tools to download programs to rcx and nxt, the crosscompiler and host lnp tools
  • brickos: complete version of brickos 0.9
  • h8300-hms: cross compiler
  • include: neccessary header files when compiling C code for the rcx
  • legos: older legos Version
  • lib: librarys for lnp and the gcc
  • nxt: Toolchain for the Lego nxt
  • old: older (previous 28.10.08) Archives and compiler, can be removed, when everything is working fine



Necessary Tools

* binutils 2.19 * gcc-4.1.1 (neccessary form arm-t-elf) * newlib 1.16 * nxtOsek2.04


export BINUTILS-SOURCE=path to unpacked source for binutils export GCC-SOURCE=path to unpacked gcc source export NEWLIB-SOURCE=path to unpacked newlib source export BINUTILS-BUILD= ./binutils-build export GCC-BULD = ./gcc-build export NEWLIB-BUILD = ./newlib-build export TOOLCHAIN = /home/lego/nxt (directory where the toolchain should be installed)

The build directorys should be ouside of the source directories!

Adjust Makefile

After running configure, you have to add the flags -mthumb -mthumb-interwork to CFLAGS_FOR_TARGET variable in the genrated Makefile for each component.

Compile binutils

cd $(BINUTILS-BUILD) $(BINUTILS-SOURCE)/configure --target=arm-elf --prefix=$(TOOLCHAIN) --enable-interwork --enable-multilib

adjust the Makefile

make all make install export PATH=$PATH:$(TOOLCHAIN)/bin

Compile gcc

cd $(GCC_BUILD) $(GCC-SOURCE)/configure --target=arm-elf --prefix=$(TOOLCHAIN) --enable-interwork --enable-multilib --enable-languages="c,c++" --with-newlib --with-headers=$(NEWLIB_SOURCE)/newlib/libc/include

adjust the Makefile

make all-gcc make install-gcc

Compile Newlib

cd $(NEWLIB_BUILD) $(NEWLIB_SOURCE)/configure --target=arm-elf --prefix=$(TOOLCHAIN) --enable-interwork --enable-multilib

adjust Makefile

make all make install

Install gcc

cd $(GCC-BUILD) make all install