How to upload a nxtOSEK application to the brick


For an appli "MyAppli", nxtOSEK builds 3 different binaries files:
The following table summerizes the results, listing the necessary firware (if any) and the tools available for uploading on Linux and (Cyg)Win:

fwexec foo_ram.bin
NeXTTool /COM=usb -download=foo.rxe
(or with the script: loadrxe foo.rxe)
NeXTTool.exe /COM=usb -download=foo.rxe

Flashing a firmware


Firmware files have the extension ".rfw", exemples are:
If any firmware is installed, the brick must be reset first:
On Linux

Warning: on Linux, only root can access the brick USB port, thus you have to "sudo" the commands (if you can!). On recent Debian/Ubuntu distributions using udev, you can bypath this problem by copying the ad-hoc rule file 70-lego.rules in /etc/udev/rules.d/.

You can use the fwflash command from libnxt-0.3:

fwflash file.rfw

or the Linux port of the NexTTool program:

NeXTTool /COM=usb -firmware=file.rfw

On Windows

Use NexTTool command line in a windows or cygwin terminal:

NeXTTool.exe /COM=usb -firmware=file.rfw

You can also use the Lego Mindstorm graphical interface, if installed (menu Tools/Upgrade Firmware).

Step by step example: using rom.bin programs on Windows

Warning : only works on Windows XP, not Windows 7

Flash the nxt OSEK bios on Windows

This should be done once:

  1. Put the brick on the "tic-tic" mode: remove/clear any firmware running on the brick: push the reset button until the screen becomes empty, press the orange button: the brick should emit a "tic-tic" sound, it is then ready to be flashed.
  2. Flash the nxt OSEK bios with the NeXTTool.exe utility:
          NeXTTool.exe /COM=usb -firmware=nxt_bios_rom.rfw

          or simply:


         Alfter flashing, the screen should be:

Upload a rom.bin program

Nxt BIOS should be in the "UPLOAD: READY" mode. Use the appflash.exe utility to upload the binary, for instance the "helloworld" from the nxtOSEK samples:

     appflash.exe  helloworld_OSEK_rom.bin

The screen should be, form left to right:


To run the application, switch off the brick (dark grey button), then switch it on (orange button): the "NXT OSEK" splash screen is displayed for a few seconds, then the brick enters the appli STP/RUN mode. Press "RUN" to start the program. When the program is running,

Splash screen

STP/RUN screen

HelloWorld program screen

Replace/re-upload a rom.bin program

Once a rom.bin program has been uploaded, it will remains in the rom of the brick, and then, be executed each time the brick is switched on.
In order to replace it, we have to put the brick in teh "UPLOAD: READY" mode: put the brick in the "STP/RUN" mode, then press at the same time the buttons STP and ENTR (left arrow+orange) for a few seconds. The screen will remain empty for q while, then the "UPLOAD: READY" screen should appear. Then, upload a program as explained before.