Nao/OpenEmbeddedFromScratch

Nao Toolchain Setup from Scratch

This document describes how to setup the toolchain from scratch required to cross compile the Fawkes Nao software to run on the Nao robot. It describes where to get the modified OpenEmbedded sources, and the commands to issue to build the required software.

General Considerations

Note that during compilation several paths will be hardcoded. Therefore the tool chain can only be used at the path where it was compiled. Hence we recommend to build the toolchain directly in /opt/oe-nao, which is the default location assumed by a fresh cloned fawkes-nao repository.

You can also use our pre-built cross toolchain packages from  http://files.fawkesrobotics.org/oe-nao (built for 32 and 64 bit platforms). Building from scratch is useful if you want to build additional packages or have a host system incompatible to the pre-built packages. The pre-built packages must be unpacked as /opt/oe-nao. Building requires a considerable amount of bandwidth (transfer volume >1GB), storage (~15 GB) and CPU time (several hours).

Requirements

You need a Linux host system on which you compile and use your toolchain. Additionally you will need a few base packages on your host system. In the  OpenEmbedded wiki distro info you find instructions for several different Linux distributions. Here we will note our experience with used distributions. You will need at least version 1.8.18 of  BitBake.

Fedora 12

To install the most important dependencies issue the following command:

yum install python m4 make wget curl ftp cvs subversion tar bzip2 gzip unzip \
  python-psyco perl texinfo texi2html diffstat openjade docbook-style-dsssl \
  docbook-style-xsl docbook-dtds docbook-utils sed bison bc glibc-devel glibc-static \
  gcc binutils pcre pcre-devel git quilt groff linuxdoc-tools patch linuxdoc-tools \
  gcc-c++ help2man perl-ExtUtils-MakeMaker bitbake

To get the required BitBake version you need to download the source package for F-13 of the  Koji BitBake package. Then rebuild it with rpmbuild --rebuild bitbake-1.8.18-1.fc13.src.rpm and install the resulting RPM file. Once F-13 is released the package is installed with the yum command above.

Getting the Code

We maintain a git repository which is based on the OpenEmbedded repository and includes patches from OpenNao point releases issued by Aldebaran. Additionally we have applied our own patches containing fixes and recipes for additionally required packages.

Clone the code with

git clone git://git.fawkesrobotics.org/oe-nao.git

This will create a directory named oe-nao which includes the required code. As mentioned below it is recommended to move this directory to /opt/oe-nao.

The source code for some packages is no longer available in the original places. To allow for a smooth building we have uploaded the sources to  http://files.fawkesrobotics.org/oe-nao/sources/. They are tried first before trying the original mirror. If you do not like that uncomment the PREMIRRORS line in conf/local.conf.

Building

Now we need to build the software. This will create the cross compilation toolchain, create a staging tree which contains the required libraries, and builds some packages that you can install on your robot, e.g. the bash and libs like libmicrohttpd. Issue the following commands

cd /opt/oe-nao
export BBPATH=$PWD
bitbake file bash bash-completion gnutls less avahi jpeg opencv \
  sqlite3 lua tolua++ libnss-mdns vim rsync libmicrohttpd libxml++

This will take a long time and use your CPU at full rate most of the time and consume a lot of storage space on your hard drive. Additionally >1GB of data is downloaded from the internet. Make sure that the system is cooled you have enough bandwidth for free, and you have a decent amount of coffee. To run the compilation in the background consider using screen.

Using the Toolchain

If you built the toolchain in /opt/oe-nao you can now simply cross-compile Fawkes Nao. Otherwise you need to modify the OE_PATH variable in config_naocross.mk.