Installing a precompiled binaries on the robot using Linux

NB: this guide is part of the information about the balancing robot information. Please refer to that for the other components.

To install the program on the robot, you need to do three things:

  1. Set up your Linux computer to recognize the Mindstorm NXT.
  2. Install a new firmware that replaces the standard Lego firmware. This is equivalent with installing a different operating system on a PC, only simpler as it's much smaller. The standard Lego software can install the normal Lego firmware if you want to go back to the normal robot operation.
  3. Install the balancing robot program that runs on top of the firmware.

Note that we have only tested this with Ubuntu 8.10. For other distributions, you may need to do some slight modifications.

Note also that some people warn that updating the firmware may brick your NXT. We have never experienced this, but if you're worried about bricking your NXT you may want to check closer with Lego about this.

1. Setting up the Linux computer

You don't need any particular drivers for Linux to connect the robot using the USB cable, but you need a small configuration file that tells Linux how to handle the robot.

To do this, put 70-lego.rules in /etc/udev/rules.d (you need to be root or use "sudo cp") and make sure it's not executable (chmod -x). After that, you may need to restart the computer, or it may be enough to run the following:

 
 sudo /etc/init.d/udev restart

2. Flashing firmware

To flash firmware, you can install fwflash from libnxt. We have used libnxt-0.3. A precompiled binary for 32-bit Ubuntu 8.10 is available here: fwflash.

To upload a new firmware, you need to put your Mindstorm into firmware flash mode. To do this, you need to press the tiny button that is in a hole at the back of the computer (in the same corner that you plug in the USB cable). We usually use a paperclip or a tiny screwdriver to do this.

The button needs to be held for at least 5 seconds. When you release it, the robot should make some fairly silent "clicking" sounds, which tells you that the robot is in firmware update mode.

To install the firmware, you need to plug in the USB cables and run fwflash:

 
  sudo ./fwflash nxt_bios_rom.rfw

A precompiled firmware is available as nxt_bios_rom.rfw if you don't want to compile your own.

It should also be possible to install this firmware using Legos own software.

3. Installing the program

The robot should now be ready to receive a program (if not, you may need to reset it).

To install a program, you can use appflash from LEJOS OSEK. With some minor tweaks to the makefile, you can get it to compile on Linux. A precompiled binary is available as appflash.

Now you can run the following to install the application:

 
 sudo ./appflash NXTway_GS_OSEK_rom-reset-ver.bin

A precompiled application binary is available here: NXTway_GS_OSEK_rom-reset-ver.bin


John Markus Bjørndalen
Last modified: Mon Mar 16 11:07:48 CET 2009