How to upload a nxtOSEK program to the NXT (Updated: January 2009)

 

Upload a nxtOSEK program by using the Enhanced NXT firmware

Upload a nxtOSEK program by using the nxtOSEK NXT BIOS

Upload a nxtOSEK program without firmware

NOTE:
If you wanted to re-install the standard NXT firmware, it needs to perform firmware update using the standard NXT programming software
(i.e. NXT-G) or using NeXTTool firmware installation feature.

NOTE:
Windows Vista users need to execute Cygwin as administrator to upload programs to the NXT. To execute Cygwin as administrator, right click on the Cygwin icon and select "execute as administrator..." menu.

 

 


Upload a nxtOSEK program by using the Enhanced NXT firmware

 

NOTE:
To upload nxtOSEK program by using the Enhanced NXT firmware, at first, it needs to upload the Enhanced NXT firmware to the NXT. However, this is required for only when other firmware (i.e. NXT standard firmware, NXT BIOS) is installed in the NXT.


1. Upload the Enhanced NXT firmware to the NXT

If you have LEGO standard programming software (i.e. NXT-G), you can upload the Enhanced NXT firmware by using firmware update feature of LEGO standard programming software. Therefore, in this section, an alternative way which uses NeXTTool is instructed.

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: Copy an Enhanced NXT firmware (i.e. lms_arm_nbcnxc_106.rfw) to NeXTTool extracted directory.

Step 3: Execute Cygwin and type the following command to change the current directory to the NexTTool extracted directory.
(NeXTTool is assumed to be extracted under C:\cygwin\nexttool directory)
$ cd C:/cygwin/nexttool

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

Step 5: Type the following command in Cygwin to upload the Enhanced NXT firmware to the NXT
$ ./NeXTTool.exe /COM=usb -firmware=lms_arm_nbcnxc_106.rfw
Program upload may take around half minutes and then, NXT LCD is turned to display some chunk from blank.

Step 6: Remove the battery from the NXT and insert it again, and then press orange rectangle button on the NXT to turn on the Enhanced NXT firmware. The Enhanced NXT firmware has same GUI as the LEGO standard firmware.

 


2. Upload a nxtOSEK program by using the Enhanced NXT firmware to the NXT

Step 1: Turn on the NXT which has the Enhanced NXT firmware

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

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

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

If program upload was succeeded, program size could be displayed in Cygwin such as the second line in the below command outputs.
Executing NeXTTool to upload helloworld.rxe...
helloworld.rxe=15280
NeXTTool is terminated.

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 program 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 program
- STP: Stop a running nxtOSEK program and back to the nxtOSEK main screen automatically
If battery voltage (BATT:) is turned to be non 0 value, the NXT is ready to run. Once the nxtOSEK program is started, NXT is fully controlled by nxtOSEK.


nxtOSEK button instructions


Hello World sample

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

 


Upload a nxtOSEK program by using the nxtOSEK NXT BIOS

 

NOTE:
To upload nxtOSEK program by using nxtOSEK NXT BIOS, at first, it needs to upload the NXT BIOS to the NXT. However, this is required for only when other firmware (NXT standard firmware) is installed in the NXT.

 

1. Upload the nxtOSEK NXT BIOS to the NXT

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 the current directory to a project directory (e.g. samples_c\helloworld) in Cygwin and build the target.

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

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


NXT BIOS screen (upload is ready)

Step 6: If BATT: is 0, remove the battery from the NXT and insert it again, then press orange rectangle button on the NXT. NXT BIOS should be turned on.

 

 

2. Upload a nxtOSEK program to the NXT by using nxtOSEK NXT BIOS

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 the current directory to a project directory (e.g. samples_c\helloworld) in Cygwin 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 program 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 program
- STP: Stop the running nxtOSEK program 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 program:
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 program without firmware

 

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 the current directory to a project directory (e.g. samples_c\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 program 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 program
- STP: Stop the running nxtOSEK program 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 program, turn off the NXT and repeat the steps from Step 2.



 

 

Home