LEGO NXT with nxtOSEK toolchain on Solaris

This is based on: http://lejos-osek.sourceforge.net/installation_linux.htm

There are three things we need to take care of:

  1. How to compile programs for the NXT using OSEK
  2. How to upload these programs to the NXT
  3. How to flash a new firmware to the NXT

Program compile

Install compilation toolchain

This step needs to be done only once. We need:

  1. a compiler and libraries for ARM (we use gcc and newlib)
  2. the nxtOSEK kernel including the system build framework

Compile programs

  • Switch to directory containing myprogram.c and myprogram.oil together with the Makefile containing:

# Name of target
TARGET = myprogram

# Path for wine executable
WINEPATH = /it/sw/wine/1.1.32/bin

# NXTOSEK root path
NXTOSEKROOT = /it/kurs/realtid/nxt/nxtosek

########################################################################

TARGET_SOURCES := \
        $(TARGET).c
TOPPERS_OSEK_OIL_SOURCE := ./$(TARGET).oil

PATH := $(WINEPATH):$(PATH)

O_PATH ?= build

include $(NXTOSEKROOT)/ecrobot/ecrobot.mak

  • Build using the "all" target: "make all"

Firmware upload

Using fwflash from libnxt

$ make all

Using lejos?

Program upload

Using lejos nxj

$ ant

  • Scripts in bin/ are then usable:

$ ./nxjupload helloworld_OSEK.rxe