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:
- How to compile programs for the NXT using OSEK
- How to upload these programs to the NXT
- How to flash a new firmware to the NXT
Program compile
Install compilation toolchain
This step needs to be done only once. We need:
- a compiler and libraries for ARM (we use gcc and newlib)
- the nxtOSEK kernel including the system build framework
- nxtOSEK:
- The "System Generator" sg.exe will need wine
- Our Solaris machines have different wine versions available in /it/sw/wine
- Download http://downloads.sourceforge.net/project/lejos-osek/nxtOSEK/nxtOSEK_v213.zip
- Extract nxtOSEK_v213.zip
- Put sg.exe into "toppers_osek/sg/sg.exe"
- Adjust "ecrobot/tool_gcc.mak":
- GNUARM_ROOT should point to gnuarm/ from above (i.e. "/it/kurs/realtid/nxt/gnuarm")
- Change "-Winline" to "-Wno-inline" in CFLAGS and CXXFLAGS to get rid of inline warnings
- Adjust "ecrobot/ecrobot.mak":
- Change WINECONSOLE to "wine" instead of "wineconsole" to prevent X window opening when sg.exe called
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
- Download libnxt
- Since scons is not available on Solaris, use the Makefile from Andreas
- Compile:
$ make all
- Use fwflash to flash firmwares:
Using lejos?
Program upload
Using lejos nxj
- Download lejos
- Patch with Andreas' patches
- Remove jbluez target from build/build.xml
- Build in build/ via
$ ant
- Scripts in bin/ are then usable:
$ ./nxjupload helloworld_OSEK.rxe
x
Search results appear here...