How to upload a program to the NXT (Updated: June 2008)

 

Inside of the NXT, there is an ARM7 based processor (ATMEL AT91SAM7S256). AT91SAM7S256 provides 256Kbytes Flash and 64Kbytes RAM. User can upload a nxtOSEK application either Flash or RAM.

Upload a nxtOSEK application program to the enhanced NXT standard firmware


Upload a nxtOSEK application program to Flash using NXT BIOS

Upload a nxtOSEK application program to RAM for direct boot

Trouble Shooting Tips

NOTE:
If you wanted to re-install the LEGO original firmware, it needs to perform firmware update using the standard NXT programming software
(e.g. NXT-G)

 

 

Upload a nxtOSEK application program to the enhanced NXT standard firmware

Step 1: Turn on the NXT which has the enhanced NXT standard firmware

Step 2: Connect PC and the NXT by USB cable.

Step 3: Change to a project directory (e.g. samples\helloworld) and build the target.

Step 4: Type the following command in Cygwin.
./rxeflash.sh

Step 5: Start the uploaded program along with the operations of the NXT standard firmware.

Step 6: After nxtOSEK splash screen is displayed, nxtOSEK main screen is displayed. nxtOSEK application is uploaded into Flash and it copied to RAM, then executed from RAM. Thus, [R] is displayed in the nxtOSEK main screen.


nxtOSEK splash screen


nxtOSEK main screen (executed in RAM)

Step 7: Buttons on the NXT has the following functionality:
- ENTR: Turn on the NXT
- EXIT: Turn off the NXT.
- RUN: Start the uploaded nxtOSEK application
- STP: Stop the running nxtOSEK application and back to nxtOSEK main screen automatically
If battery voltage (BATT:) is turned to be non 0 value, the NXT is ready to run. Once the nxtOSEK application is started, NXT is fully controlled by nxtOSEK.


nxtOSEK button instructions


Hello World sample

Step 8: Enhanced NXT standard firmware allows user to upload multiple nxtOSEK application programs to a NXT such as other NXT standard programming languages supported. However, size of a nxtOSEK application is up to 64Kbytes. If you wanted to write larger program over 64Kbytes, please use NXT BIOS.


 

Upload a nxtOSEK application program to Flash using NXT BIOS

When you use nxtOSEK first time, it needs to upload NXT BIOS before uploading nxtOSEK application to Flash.

Upload NXT BIOS to Flash

Step 1: Reset the NXT
To go into firmware update mode, press the reset button (at the back of the NXT, upper left corner beneath the USB connector) for more than 5 seconds while the NXT is turned on. The NXT will audibly tick when it is in firmware update mode.

Step 2: Connect PC and the NXT by USB cable.

Step 3: Change to lejos_osek\bin directory in Cygwin.

Step 4: Type the following command in Cygwin.
./biosflash.exe

Step 5: After a few seconds, NXT BIOS screen is displayed in the LCD.


NXT BIOS screen (upload is ready)

NOTE:
Uploading NXT BIOS is required only for the first time to upload a nxtOSEK application program to Flash.

 

Upload a nxtOSEK application to Flash

Step 1: Make sure that NXT BIOS screen is displayed and upload is ready.

Step 2: Connect PC and the NXT via USB cable.

Step 3: Change to a project directory (e.g. samples\helloworld) and build the target.

Step 4: Type the following command in Cygwin.
./appflash.sh

Step 5: Upload status can be monitored by progress bar in the LCD display. A few seconds later, upload is finished.


NXT BIOS screen (upload is finished)

Step 6: Press EXIT button (gray colored rectangle button) to turn off the NXT.

Step 7: Press ENTR button (orange colored rectangle button) to turn on the NXT. After nxtOSEK splash screen is displayed, nxtOSEK main screen is displayed. If a nxtOSEK application is executed from Flash, [F] is displayed in the nxtOSEK main screen.


nxtOSEK splash screen


nxtOSEK main screen (executed in Flash)

Step 8: Buttons on the NXT has the following functionality:
- ENTR: Turn on the NXT
- EXIT: Turn off the NXT
- RUN: Start the uploaded nxtOSEK application
- STP: Stop the running nxtOSEK application and automatically back to nxtOSEK main screen
If battery voltage (BATT:) is turned to be non 0 value, the NXT is ready to run.


nxtOSEK button instructions


Hello World sample

Step 9: To upload a new nxtOSEK application to Flash:
Press ENTR + STP button for more than 1 seconds while nxtOSEK main screen is displayed, the NXT is turned off automatically.
Press ENTR button to turn on the NXT again, then NXT BIOS screen is displayed.

 

 

Upload a nxtOSEK application program to RAM

Step 1: Reset the NXT
To go into firmware update mode, press the reset button (at the back of the NXT, upper left corner beneath the USB connector) for more than 5 seconds while the NXT is turned on. The NXT will audibly tick when it is in firmware update mode.

NOTE:
Step 1 is required only for the first time to upload a nxtOSEK program into RAM of the NXT.

Step 2: Connect PC and the NXT by USB cable.

Step 3: Press ENTR button (orange colored rectangle button) to turn on the NXT.

Step 4: Change to a project directory (e.g. samples\helloworld) and build the target.

Step 5: Type the following command in Cygwin.
./ramboot.sh

Step 6: After nxtOSEK splash screen is displayed, nxtOSEK main screen is displayed. If a nxtOSEK application is executed from RAM, [R] is displayed in the nxtOSEK main screen.


nxtOSEK splash screen


nxtOSEK main screen (executed in RAM)

Step 7: Buttons on the NXT has the following functionality:
- ENTR: Turn on the NXT
- EXIT: Turn off the NXT. (If the program is executed in RAM, the program is gone by turning off the NXT)
- RUN: Start the uploaded nxtOSEK application
- STP: Stop the running nxtOSEK application and back to nxtOSEK main screen automatically
If battery voltage (BATT:) is turned to be non 0 value, the NXT is ready to run.


nxtOSEK button instructions


Hello World sample

Step 8: To upload a new nxtOSEK application to RAM, turn off the NXT and perform from Step 2.

TROUBLE SHOOTING TIPS

Q1: During program upload, the following message was appeared in Cygwin.
NXT not found. Is it properly plugged in via USB?

A1: Make sure PC and the NXT are connected by USB cable.
A2
:
Remove the battery for 5 seconds and insert again.
A3: Re-install LibUsb to the directory which does not contain spaces and multi-byte characters.
A4:
Change the USB port on PC . If the USB port was valid, a new USB device installation message should be appeared on the Windows Taskbar.
A5: Check Control Panel->System->Hardware->Device Manager->LEGO Devices->LEGO MINDSTORMS NXT Firmware Update Mode->(right click on the LEGO MINDSTORMS NXT Firmware Update Mode) Property->Driver->Driver Details. libusb0.sys should be appeared besides with fantom.sys. If not, re-install LibUsb.



Q2: After program upload, any buttons do not work and the battery voltage display (BATT:) remains 0.

A: Remove the battery for 5 seconds and insert it again.

 

 

Home