Trampoline on Mindstorm NXT : links, installation, bugs, miscellaneous

Links

Installation and running trampoline

After having downloaded Trampoline, follow the steps described in file documentation/getstarted/getstarted.pdf except for the following steps:

  • gcc-arm installation. Rather than using pre-compiled versions on http://www.gnuarm.com that are outdated, more recent pre-compiled versions can be found on http://embdev.net/articles/ARM_GCC_toolchain_for_Linux_and_Mac_OS_X. Installation of gcc from sources is a bit hard on macOS 10.6, prefer precompiled versions if you are using macOS 10.6.
  • Drivers installation. The link to download the drivers is http://mindstorms.lego.com/en-us/support/files/default.aspx#Drivers and not http://mindstorms.lego.com/en-us/support/files/default.aspx #Drivers as indicated in documentation/getstarted/getstarted.pdf

To execute a program :

  • cd examples/arm/nxt/simple (contains a very simple “hello-world”-like program
  • if you are using as-arm 2.16.1 downloaded from http://embdev.net/articles/ARM_GCC_toolchain_for_Linux_and_Mac_OS_X, change the ASFLAGS -mcpu=arm7tdmi-s to -mcpu=arm7tdmi
  • modify the nxt_simple.oil file to fit your gcc installation path (second LDFLAGS attribute). See commented OIL file here, lines to be changed are indicated in red.
  • you can then follow the steps indicated in the documentation/getstarted/getstarted.pdf manual

To develop your applications outside the Trampoline file hierarchy:

  • modify the OIL file to specify the Trampoline installation path (see commented OIL file here, lines to be changed are indicated in red).

Alternative installation method

An alternative to achieve the installation of a working environnement for the NXT Bricks is to use the scripts in the archive: lego.install.tar.bz2 or on the (more recent) git repository: git@github.com:Gaudeval/nxt-rtos-setup.git (https://github.com/Gaudeval/nxt-rtos-setup).

  • Unzip the archive and go the lego.install folder.
  • To install gcc-arm-elf (4.5.1), just run the build.sh script in the gcc folder. Upon completion, the installed files (libraries and binaries) will be put under gcc/install.
  • To install the latest Trampoline development version, similarly run the build.sh script in the trampoline folder. Upon completion, goil binaries will be under trampoline/install/bin and trampoline will be under trampoline/install/trampoline.
  • Instructions for compiling nexttool can be found in the README file included in the archive. A pre-compiled binary, for a 32 bits Linux, can be found under the nexttool directory.
  • app_template and scripts in the scripts folder can be used to create, compile and send applications to a NXT brick. They depend on environment variables which are set in the env_setup script.
  • The env_setup script defines the required environment variables for gcc-arm-elf and the provided scripts. It should be sourced before using said scripts or the compiled gcc (source env_setup).

Do not forget to alter the env_setup script or to add the appropriate entries in your .bash_rc configuration file.

The gcc compilation process should be patched to prevent problems with the loader looking for libmpc and other dependencies.

Laboratory works environment setup

The setup of the environment for the real-time laboratory works is a simple two-step process:

  • Install the files used by the students under the /share/tr_m1_esir2 folder, from a prior year installation.
    cp -r /import/share/2010-2011/tr_m1_esir2 /share/
  • Install the 99-lego-nxt.rules udev rule under /etc/udev/rules.d to give students the permissions they need to send programs on the bricks through USB. The 99-lego-nxt.rules contains a single line:
    BUS==”usb”, ATTRS{idVendor}==”0694″, MODE=”0666″
    Requires the intervention of the administrators to ensure the deployment of the file on all machines.

Bricks preparation

Before any brick can be used during laboratory works, an enhanced firmare has to be uploaded, e.g. lms_arm_nbcnxc_107.rfw from the nexttool website (http://bricxcc.sourceforge.net/lms_arm_jch.zip). The process if further described in the get started documentation provided with trampoline (under documentation/getstarted.pdf) and the lejos documentation (http://lejos-osek.sourceforge.net/installation_linux.htm#FIRMW).

  • The brick must first be set to firmware update mode. This is achieved by maintaining the reset button at the back of the NXT, beneath the USB connector, hidden in one of the holes, for a few seconds. The success of the operation is clued by the ticking noise coming from the brick.
  • Nexttool can then be used to upload the firmware, either using the command center on mac or the command nexttool /COM=usb -firmware=lms_arm_nbcnxc_107.rfw under windows. Linux users are required to use, and are likely to need to compile, fwflash (http://libnxt.googlecode.com/files/libnxt-0.3.tar.gz). The latter depends on libusb and scons for compilation.

Bugs

All bugs have been signalled on the Trampoline forums.

  • Problem with sound. In file machines/arm/nxt/Makefile (makefile compiling the sensors/actuators management libraries), file sound.c is commented. When uncommenting the set of commented lines (3), the programs using the sound routines compile, but the robot does not make any sound. Some calls to the sound management routines crash the robot.
  • Doxygen documentation. Due to the way OSEK/VDX functions are declared in Trampoline, doxygen does not detect function interfaces correctly, and thus the doxygen-generated documentation misses function names.

Comments are closed.