RAMSES: Install targets

Install targets to execute code generate by RAMSES

RAMSES can generate code for the following targets:

  • Linux
  • nxtOSEK
  • POK

For the last two targets, you need to install programs to launch them.

How to install nxtOSEK and pok

Follow this link to download the install script.

By default, the install script will install nxtOSEK and POK in $HOME/ramses-resources. If you plan to contribute to RAMSES, keep this default setting. Otherwise, you can choose a different location by passing the install path as an argument to the script.

The install script will install both nxtOSEK and pok, their dependencies and make most of the necessary changes in the ntxOSEK files.

Make sure to read the script before hand, and change what needs to be changed (mainly directories paths, there are many of them and they are kinda important to find the needed files).

Run the script (install-ramses-targets.sh). You will be asked to enter you root password in order to install some basic tools (gcc, binutils, qemu…).

Once the script is executed, you are almost done, the only thing left for you to do for nxtOSEK users is to modify file nxtOSEK/ecrobot/ecrobot.mak line 84 … Add the value

$(USER_INCLUDES)

to the variable TOPPER_INC_PATH.

This is it! … Next sections provide information about the targets, with a documentation of what the install script does (in case you need to adapt the install procedure to your computer’s configuration).

nxtOSEK

Go to the following nxtOSEK website: http://lejos-osek.sourceforge.net/.

Download and install nxtOSEK following the instructions in the “Installation” page.

For Linux users: the script “build_arm_toolchain.sh” is not up-to-date for recent versions of GCC. Open it with an editor, and change the “GCC_BINARY_VERSION” to your version of GCC. Example for Ubuntu 16.04 users:

GCC_BINARY_VERSION=/usr/bin/gcc-5

Then change the line where CC variable is exported to dodge compilation problems like following:

export CC="$GCC_BINARY_VERSION -fgnu89-inline"

The option “-fgnu89-inline” is required since the default option of GCC changed in recent versions. Before launching the script, you need also to install a new version of texinfo. The version 4.13 is correct. Extract the archive and then install it with these commands:

./configure
make
sudo make install

Once you have correctly installed nxtOSEK, you need to change the file “ecrobot/ecrobot.mak”. Open it and go to the line 304. You should have the following line:

WINECONSOLE := wineconsole

Add a new line below with the following:

WINE := wine

Then go to the line 330 in the “else ifeq ($(TOPPERS_KERNEL), OSEK_COM) … else …” clause. Change this clause with the following:

else
$(TOPPERS_CFG_SOURCE) $(TOPPERS_CFG_HEADER) implementation.oil : $(TOPPERS_OSEK_OIL_SOURCE)
    @echo "Generating OSEK kernel config files from $(TOPPERS_OSEK_OIL_SOURCE), $(WINE)"
    $(WINE) $(TOPPERS_OSEK_ROOT_SG)/sg/sg ${TOPPERS_OSEK_OIL_SOURCE} \
-os=ECC2 -I${TOPPERS_OSEK_ROOT_SG}/sg/impl_oil \
-template=${TOPPERS_OSEK_ROOT_SG}/sg/lego_nxt.sgt

This is done not to use Cygwin program, which is useless since we are already on a Linux environment.

When installing libnxt, if you see undefined references to usb_init() and other functions from libusb, the problem come from the fact that linker options are in the wrong order. To solve this you need to put the -lusb at the end of the command like this:

gcc -o fwflash main_fwflash.o -L. -lnxt -lusb

 

For all users:

When you download the nxtOSEK archive, there may be a missing file sg.exe, it is required to have it. Good luck finding it.

To use RAMSES with nxtOSEK, you need to add a line in the “ecrobot/ecrobot.mak” file. Add to the variable “TOPPERS_INC_PATH” (line 84) the value:

$(USER_INCLUDES)

You will need also to copy the “sg.exe” file, available on the download page of nxtOSEK (detailed informations are on this page).

To install programs on your brick, you need the following deployment tools, and you need to change the firmware of the Lego brick as follows

Step 1: To set the brick 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: Type the following command 
$ <deployment_tools_path>/NeXTTool /COM=usb -firmware=<deployment_tools_path>/lms_arm_nbcnxc_107.rfw
Program upload may take around half minutes and then, NXT LCD is turned to display some chunk from blank. 


Step 4: 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.

POK

Install POK from the following git repository: https://github.com/pok-kernel/pok. You need the following programs on your machine to make POK works:

  • GCC
  • binutils
  • perl
  • libxml-xpath-perl (the XML::XPath::XMLParser)
  • libxml-libxml-perl (the XML::LibXML Perl module)
  • mtools (optional)
  • qemu
  • make

Then, in the root of the repository, run this command:

$./misc/conf-env.pl

Depending on your architecture, one configuration will be created. If not, install the missing programs.