Quick instructions

Clone the sources repository, make sure you have an ARM toolchain and picolibc installed then run make:

git clone http://git.ni.fr.eu.org/nxt-firmware.git/
cd nxt-firmware
make

The file nxt_firmware.bin is the one to program on your NXT brick. You can use LibNXT to do it, or any other NXT firmware updater.

Warning: installing the new firmware will erase all files on your NXT brick, make sure to make a backup if you need them.

More details

GCC toolchain

NXT Improved Firmware can be built using the free software toolchain GCC.

To compile NXT Improved Firmware, you need a toolchain targeting the ARM processor used in the NXT. The toolchain includes:

  • the compiler which transforms C files to machine code (GNU GCC),
  • the assembler which transforms assembly files to machine code (GNU as),
  • the C and math libraries (newlib or picolibc),
  • the linker which gathers object files (GNU ld),
  • other miscellaneous utilities (GNU binutils).

Firmware source code relies on some assumptions about compiler behaviour (struct packing and size for example), therefore you need a compiler using the ARM EABI binary format (see FAQ). Unless you have a really old toolchain, this should not be a problem.

LEGO initially used the IAR proprietary tool chain, this is not supported by NXT Improved Firmware.

NXT Improved Firmware uses picolibc library since 1.29.4 release.

Install toolchain

You can use the toolchain provided with your distribution, for example if you use a Debian based distribution:

sudo apt install gcc-arm-none-eabi picolibc-arm-none-eabi

Or get a toolchain for your computer on ARM web site and make sure to add it to your PATH. Also install the corresponding picolibc release.

Make sure gcc is accessible, for example:

% arm-none-eabi-gcc --version
arm-none-eabi-gcc (15:12.2.rel1-1) 12.2.1 20221205
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

%