Recent Changes - Search:

Tracking

Hardware

Software

Mega Plan

Etc.

Gumstix

We use the Gumstix embedded computer for all our computations. Our Gumstix has the following specs:

ProcessorIntel XScale PXA255 200MHz
Memory4 MB
Storage128 MB via Compact Flash Card
WirelessInfineon Bluetooth™ Module
Power3.4V - 5.2V takes Li-Ion, Li-Polymer, 3-NiMH, standard 4.5V or 5.0V inputs
OSBootloader: U-boot
Kernel: Linux 2.6.11

The Gumstix attaches to a Waysmall buddy board via 60-pin Hirose connector. The Waysmall provides two serial ports, client USB, power, and GPIO pins. I2C is accessed through the GPIO pins.

Getting the Gumstix up and running required several modifications to the filesystem. We modified a local copy of the Linux root filesystem, then re-flashed the Gumstix. See the Development section for information on how to download and setup the Gumstix buildroot on your local machine.

Login

You can login to the Gumstix in two ways: over the serial port, or over Bluetooth. Initially, you will have to login using the serial port, and after completing the configuration described here you should be able to login via Bluetooth. Using a serial port, you can login to the Gumstix from your local machine. If you do not have a serial port on your computer, then a USB to serial converter is needed. We found the Keyspan and Manhattan converters to work well. Depending on your local machine, you might also need a null-modem (and possibly a gender convertor or two). Using a program like kermit, Z-term, hypterterm, or minicom, create a serial connection between your computer and the ttyS0 port on the Waysmall computer. The ttyS0 port is the one closest to the power supply. By default, a getty is running on this port which allows you to login. Make sure the serial port settings are speed 115200, 1 stop bit, 8 bits, and no parity. Power the Gumstix and you should see the bootup messages from the Gumstix on your local machine. See the Gumstix Getting Started guide for more details.

Bluetooth

After downloading the Gumstix buildroot, the first step is configuring Bluetooth, which requires several modifications to the Gumstix, and to a Belkin Bluetooth Access Point. Here are all the details.

I2C

The Gumstix and Brainstem can communicate with one another via I2C, but not without modifications to both the Brainstem and the Gumstix. Here are the details how to modify the Brainstem for I2C.

Getting I2C working on the Gumstix required the creation of a device driver Attach:brainstemi2c.tar.gz. Download the tar file, and place all the files into the the appropriate locations under gumstix-buildroot/build_arm/linux-2.6.11gum. Goto gumstix-buildroot/build_arm/linux-2.6.11gum and type make ARCH=arm CROSS_COMPILE=arm-linux- menuconfig (add DEPMOD=true on Mac OS X) to configure the kernel to support I2C. To configure the kernel:

  1. Select I2C Support
  2. Make I2C support and I2C device interface be built into the kernel
  3. Select I2C Hardware Bus Support
  4. Make I2C interface in Intel PXA2x0 be built into the kernel
  5. Return to I2C Support and select Robot Hardware Support
  6. Make Acroname Brainstem Driver be built into the kernel
  7. Exit menuconfig

ext2fs

The MMC card must be reformatted to ext2fs. This filesystem implements user permissions and allows the /home directory to be hosted on the MMC card. However, with this filesystem, the MMC card can become corrupted during a shutdown that does not follow the proper shutdown sequence (e.g., when the Gumstix is unplugged).

Since the filesystem on the MMC card has changed, you must now compile ext2 support into the kernel. Goto gumstix-buildroot/build_arm/linux-2.6.11gum and type make ARCH=arm CROSS_COMPILE=arm-linux- menuconfig (add DEPMOD=true on Mac OS X) to configure the kernel to support ext2. To configure the kernel:

  1. Select File systems
  2. Make Second extended fs support be builtin to the kernel
  3. Exit menuconfig

Final Configuration

The default configuration has a few problems:

  1. The Belkin Bluetooth Access Point and PAN the Gumstix cannot talk to each other.
  2. The Gumstix tend to go dead on the network after short periods of inactivity (as short as 2 minutes).
  3. The network is set up for DHCP instead of static IP's.
  4. The MMC card is not mounted at boot.
  5. The timezone is incorrect.
  6. The system time needs to be set upon bootup.
  7. The getty on ttyS0 is set to respwan.
  8. The MMC card has the wrong filesystem.

Download this config script Attach:superconfig and place it in gumstix-buildroot. Make sure to change variable values to match your setup. The superconfig file fixes the network timeouts by creating a network-heartbeat script that pings 1.1.1.1 (a non-working address) once per minute with one packet. This network activity keeps the Gumstix working on the network while not annoying anyone with random pings. The superconfig file also fixes the Bluetooth problem by editing the default settings and creating a new startup script. The superconfig also edits the file /etc/network/interfaces to make bnep0 active and a static IP. A file is added to /etc/init.d that mounts the MMC card upon boot. The file /etc/fstab is changed to reflect the ext2 filesystem on the MMC card. Finally, the timezone is set to Eastern Standard Time, and a file is added to /etc/init.d to set the system time upon boot.

Build the Kernel and Modules

You must first build the kernel in the proper format. Go to gumstix-buildroot/build-arm/linux-2.6.11gum and

  1. Build the kernel: make ARCH=arm CROSS_COMPILE=arm-linux- uImage.
  2. Add the kernel modules by typing make ARCH=arm CROSS_COMPILE=arm-linux- modules.

On Mac OS X, you need to add DEPMOD=true to the above commands.

Make the Filesystem

To build the root filesystem go to gumstix-buildroot and type make (or make DEPMOD=true on Mac OS X). This process will produces a file called root_fs_arm which is the root filesystem.

Re-flash the Gumstix

After you run make on your local machine, you need to transfer the new root filesystem to the Gumstix. This process is called flashing, since you will be replacing the contents of flash memory with the new filesystem. You can copy the new filesystem either via Kermit, or the MMC card. See the Gumstix Tutorial for more information.

Kermit Transfer After connecting your local machine to the Gumstix with serial cable, boot the Gumstix. When you see the U-boot countdown, press a key to interrupt it. Type loadb a2000000, then go back to Kermit mode, and send the filesystem image by typing:

  1. robust
  2. send root_fs_arm (This takes a while.)

Now you need to replace the old filesystem image with the new one. Go back to the Gumstix and type:

  1. era 1:2-31
  2. cp.b a2000000 40000 ${filesize}
  3. boot

Its very important that you type 2-31, otherwise you will erase the bootloader!

MMC Card Transfer Using the MMC card is both easier and faster than using serial. A slightly different procedure is needed to transfer the new filesystem image. After copying root_fs_arm from your local machine to the MMC card, insert the MMC card into the Gumstix, and boot. We suggest that you login to the Gumstix over serial. Interrupt the bootloader by pressing a key during the countdown. Type the following to install the new filesystem image:

  1. mmcinit
  2. fatload mmc 1 a2000000 root_fs_arm
  3. era 1:2-31
  4. cp.b a2000000 40000 ${filesize}
  5. boot

Directory Structure

Almost everything is stored on the MMC card, and then linked to the standard Linux directory structure on the Gumstix. We use a directory structure like:

Folder/Content DescriptionFilesystem Location
Mount point for the MMC card/mnt/mmc/
All custom software/usr/local/ (linked to /mnt/mmc/usr/local/)
All binaries/usr/local/bin/
JamVM/Jikes/etc. libraries/usr/local/lib/
Python VM/usr/local/python/
Source code/usr/local/src/
All robot-specific software/usr/local/robot/
Java robot stuff/usr/local/robot/java/
User directories/mnt/mmc/home/

Final Modifications

There are few modifications you must make directly on the Gumstix.

I2C

You will need to create (one time) a character device file with Major number 42 and Minor number 1:

  1. cd /dev
  2. mknod brainstem c 42 1

e2fsck

The new filesystem on the MMC can become corrupted if the proper shutdown sequence is not followed. To fix any filesystem corruption we cross compiled e2fsck from the e2fsprogs package with the following configure options:

 #!/bin/tcsh 

 setenv CFLAGS "-D__ARM__ -D__uclinux__" 
 setenv TEMPHOST arm-linux
 setenv CC ${TEMPHOST}-gcc
 setenv AR ${TEMPHOST}-ar 
 setenv RANLIB ${TEMPHOST}-ranlib 

 setenv BUILD_GCC ${CC} 

 e2fsprogs-1.37/configure --host=${TEMPHOST} --build=yourlocalmachine-OS

The complete package does not build, however the e2fsck binary compiles correctly, and is located under e2fsprogs-1.37/build/e2fsck. Copy the e2fsck binary to the Gumstix under /usr/local/bin for use as an utility.

Serial Port Communication

Java and Python don't have native facilities for changing the ioctl of the serial port, making communication with the Brainstem and CMUCam2 problematic. Among other solutions, we have created a serial daemon which listens in on a socket and shoves everything it hears out a serial port (and vice versa). Thus a Java/Python program can talk out the serial port just by connecting to a socket with the daemon running.

The serial daemon in binary and source (a single C file), plus instructions for use, can be found here: serialdaemon.1.tar.gz

Edit - History - Print - Recent Changes - Search
Page last modified on June 18, 2005, at 02:12 PM