Gumstix
Instructions for building player into the Gumstix OS for use with iRobot
Contents |
Get Buildroot
To use the Buildroot, you must first obtain the Buildroot.
All files are available from Gumstix's public Subversion repository.
You will need the following things on your development host machine:
- A Subversion client, to check out the files (and, later, to get updates). You can check if your Linux box already has one by entering which svn at the command prompt.
- A C compiler, such as gcc and associated tools. Most Linux systems already have these tools installed; if yours are missing, install your distribution's development tools package.
- You will need to following tools installed: autoconf, automake, bison, byacc, gcc, gcc-c++, make, ncurses-devel, subversion, zlib-devel, texinfo, flex.
- A network connection, both to fetch the Buildroot itself, and for the Buildroot to download subsequent files.
- About 150MB of free disk space.
To check out the current revision of the Buildroot, enter the following on your development host:
svn co http://svn.gumstix.com/gumstix-buildroot/trunk gumstix-buildroot
Configure And Make Buildroot Toolchain
now type
cd gumstix-buildroot make defconfig rm .config make
This will stop and prompt you for the "Target Architecture Variant". Choose either
- "11. xscale (eg Gumstix basix/connex) (BR2_xscale) (NEW)"
- "12. iwmmxt (eg Gumstix verdex) (BR2_iwmmxt) (NEW)".
Then you will be prompted for the processor speed of your gumstix. Make the appropriate selection.
make menuconfig
- Under "toolchain options" activate "build/install c++ compiler and libstdc++".
- Under "Package Selection for the target" activate "wpa_supplicant", "libtool"
- Under "Package Selection for the target" deactivate "gpsd"
make
Take a break ;) this takes a while.
When you're finished, you can double check to ensure that the xdr routines are present by doing:
cd build_arm_nofpu/staging_dir/lib ../bin/arm-linux-nm libc.a | grep xdr_bytes
and you should see:
U xdr_bytes 00000594 T xdr_bytes
Your toolchain will have a bin directory where the cross-compiling executable tools, such as arm-linux-gcc and arm-linux-ld reside.
This is located at [path to build root]/build_arm_nofpu/staging_dir/bin
Add this directory to your PATH environment variable.
Removing Packages from the Filesystem
If you enter the configuration menu and deselect a package, you may be surprised to discover that it's still in your filesystem image.
The Buildroot will rebuild only the aspects of your system that have changed -- and if you deselect a package, the change is that the Buildroot now no longer even looks at the package. It will not build the package's files, but it will also not remove them.
You can fix this by manually removing the package's files from gumstix-buildroot/build_arm_nofpu/root, or simply by erasing that whole directory -- the Buildroot will restore it when you next run make.
ATTENTION wifistix users- If you delete the gumstix-buildroot/build_arm_nofpu/root directory then the wifistix support will not be properly re-installed unless you also delete the gumstix-buildroot/build_arm/.cf8385 file.
Configure And Build Player
From player base diretory type:
$ ./configure --build=x86-linux --host=arm-linux --disable-shared --disable-alldrivers --enable-roomba --prefix=[path to buildroot]/build_arm_nofpu/root/usr/local
The configure script will automatically look for the arm-linux- tools, which should already be in your PATH.
From player base diretory type:
make
One final step to save space is to strip the symbol/debug information out of the binary:
arm-linux-strip server/player
Now just type:
make install
Finish Configuration
- roomba.cfg
driver ( name "roomba" provides ["position2d:0" "power:0" "bumper:0" "sonar:0"] port "/dev/ttyS0" safe 1 )
- switch tty
Login to gumstix and edit /etc/inittab change the following:
::respawn:/sbin/getty -L ttyS0 115200 vt100M
to
::respawn:/sbin/getty -L ttyS2 115200 vt100M
Flash The File System (With A Serial Cable)
You can flash a Gumstix easily using a standard serial cable and Kermit/cKermit, or a communications program that supports Kermit-style file transfer. Connect the cable to the Gumstix's console serial port and start your communications software.
WARNING: TeraTerm on the Windows platform is know to have a broken kermit implementation which will cause corruption in files it transfers. Do not use TeraTerm to transfer files to u-boot for flashing, or you run severe risk of rendering your gumstix un-bootable
To flash the Gumstix, you will be communicating with the uboot bootloader. Uboot uses 115200 baud, 8 data bits, 1 stop bit, and no parity (115200/8n1), with no flow control. For the Kermit-style file transfer, your communications software must be set to send files in binary format.
Now, turn on your Gumstix. Almost immediately, it will prompt you (through the serial console) to press any key to stop booting and access uboot. Press a key and enter the following:
set carrier-watch off set speed 115200 set file type bin set reliable fast set flow-control none set rec pack 4096 set send pack 4096 set window 5 set prefixing all
At the GUM Uboot prompt, tell it to receive a file:
loadb a2000000
(There are six zeros following the a2 in that line.)
Now, send your filesystem image. Once your file transfer succeeds, the Gumstix is holding your new filesystem in RAM. The contents of Flash are still intact; aborting at this point will simply revert to your old filesystem.
Getting the new filesystem to take hold is a two-step process. First, the old filesystem must be erased; then, the new filesystem must be written from RAM to flash.
To erase the old filesystem, enter
protect on 1:0-1 erase all
The first line protects flash sectors 0 and 1, which contain the uboot bootloader you're currently communicating with. This line is very important. If you omit it, your Gumstix will be unusable and will have to be reflashed using a far more complicated process.
Now, commit your new filesystem to flash:
cp.b a2000000 40000 ${filesize}
This copies your new filesystem into flash (at address 40000 hex, for the curious). ${filesize} is a reference to the variable filesize, which was set by your file transfer. If this does not work simply convert the size of rootfs.arm_nofpu.jffs2 into hex (lowercase letters) and use instead. Also on different versions of uboot the variable can be either ${filesize}, $(filesize) or $filesize.
Once the copy completes, you can boot directly into your new filesystem by typing:
boot
Alter bootloader (uBoot)
Access the uBoot boot loader and type the following:
setenv silent true setenv bootargs console=ttyS2,115200n8 root=1f01 rootfstype=jffs2 reboot=cold,hard saveenv