Two development packages are needed to produce code for the robots:
- Gumstix Buildroot
- Brainstem Libraries
Building the Gumstix Buildroot
The Gumstix filesystem is an open source package. You can obtain it using subversion: svn co http://svn.rungie.com/svn/gumstix-buildroot/trunk gumstix-buildroot. Building a new Linux filesystem requires some special setup depending on your local operating system.
The default makefile contains several things we do not need including network tools, Compact Flash and audio capability. In the gumstix-buildroot directory, edit the main makefile and comment out the lines:
- TARGETS+=lrzsz target-mtd-utils
- TARGETS+=pcmcia hotplug hostap wtools
- TARGETS+=bplay madplay aumix
Finally, from the Network Services and Apps line, eliminate boa as a target.
Before you compile the Gumstix toolchain, look for an option in the top-level makefile for the gumstix-toolchain called "INSTALL_LIBSTDCPP" and set it to true. Ignore the warning that is posted next to it in the Makefile, it will still work OK. This lets you run C++ code, which is required for building the Brainstem libraries. Also, don't use soft float, because then the Brainstem libraries and your programs will drop down to the kernel for floating point support and the current kernel flashed on the Gumstix does not support this.
Double check the top-level makefile for any other options that are specific to your Gumstix. In particular, check the GUMSTIX_400MHZ variable. Now, call the appropriate version of make for your operating system (see below for details). Make sure you have an internet connection.
When the build has finished, you have a JFFS filesystem: root_fs_arm. It contains the linux kernel, and all of the libraries and utilities for the stock Gumstix. See the Gumstix section for how to transfer the new filesystem to the Gumstix.
After building the Gumstix toolchain, add gumstix-buildroot/build_arm/staging_dir/bin to your PATH for access to the ARM C compiler.
Gumstix Buildroot on Mac OS X
You need administrator access on the OS X system to install some packages which are needed to create the buildroot environment.
The instructions below overwrite some of Apple's versions of tools with GNU versions. If you do not want that to happen, change the --prefix to something else. You'll have to modify your PATH (and probably other things too) in order to compile the buildroot environment.
As noted from the Gumstix wiki, you may also use Darwin Ports or Fink to install gettext, sed, wget, fileutils, and subversion.
- Download and install Xcode Tools 1.5 from Apple's developer site
- Download and install November2004GCCUpdater from Apple's developer site. This gives you gcc 3.3.
- Download and install gettext http://ftp.gnu.org/gnu/gettext/gettext-0.14.tar.gz
- ./configure --prefix=/usr --disable-csharp
- make
- sudo make install
- Download and install sed http://ftp.gnu.org/gnu/sed/sed-4.1.2.tar.gz
- ./configure --prefix=/usr
- make
- sudo make install
- Download and install wget http://ftp.gnu.org/gnu/wget/wget-1.9.1.tar.gz
- ./configure --prefix=/usr
- make
- sudo make install
- Download and install fileutils http://ftp.gnu.org/gnu/fileutils/fileutils-4.1.tar.gz
- ./configure --prefix=/usr
- make
- sudo make install
- Download and install subversion http://subversion.tigris.org/tarballs/subversion-1.0.9.tar.bz2
- ./configure
- make
- sudo make install
- Get the Gumstix source via subversion
- Modify the Gumstix makefiles
- Edit gumstix-buildroot/make/zlib.mk
- Replace all occurances of libz.so.* with libz.1.2.2.dylib
- Make the gumstix buildroot (this takes a long time)
- cd gumstix-buildroot
- make
Gumstix Buildroot for Linux
On Linux, you will need the latest versions of the following: subversion, gcc, libc6-dev, wget, bzip2, bison, flex, gettext, make, perl, g++, zlibc, and zlib1g-dev. After you download the source code, traverse to gumstix-buildroot and
- Modify the Gumstix makefiles
- Edit gumstix-buildroot/make/zlib.mk
- Replace all occurances of libz.so.* with libz.1.2.2.dylib
- Make the gumstix buildroot (this takes a long time)
- cd gumstix-buildroot
- make
Gumstix Buildroot for Microsoft Windows
Building the filesystem under Windows requires a Linux emulator. Either install Cygwin and follow the instructions under the Linux section above, or see the Gumstix Wiki for documentation on how to set up a buildroot.
Buildroot problems you might encounter
- You must install bison on your build machine. If you indeed have bison, type
which bison. This will return a path like /usr/local/bin. cd to make and modify binutils-uclibc.mk. Search for bison and modify the path it is looking for to match your system.
- You must install Flex. Same as solution for bison.
- You must install gettext. This one is misleading. It's actaully looking for msgfmt. Try finding mssgfmt and moving the binary to where it would like it.
Brainstem Libraries
The Brainstem libraries contain C and Java code to access the Brainstem via serial port. These libraries are required to communicate with the Brainstem from the Gumstix. The libraries are available from Acroname. Click on Downloads (you might have register first), then find the Brainstem development libraries. After you decompress the libraries you will have a directory called brainstem. This is the directory where you will do all your work. Edit the makefile to comment out references to aGarcia. We do not use this code, and it can cause errors when compiling for the Gumstix. Traverse to the brainstem directory and type make. You might see a bunch of errors at this point. Don't panic! These errors will disappear on subsequent calls to make.