Introduction:------------------------------------------------------------------------------------------------------------------------------------------------------Parker01 uses a Gumstix for higher level processing. The Gumstix works on a embedded linux system and boasts an Intel XScale® PXA255 400Mhz processor.Parker01 currently uses the Gumstix to implement a Extended Kalman Filter that obtains information from onboard sensors (other than the motor encoders). Communication to the Gumstix from a computer is currently via Bluetooth. The Gumstix can also be connected and programmed directly using the 60 pin Hirose connector. The procedures for these are detailed below in the "Working of Component" section of this guide. Communication from the Gumstix to the TAMU Robot Controller is via the 60 pin connector on the Gumstix controller. Gumstick to Control Board Communication is performed via SPI communication ===================================================================================Data Sheets and Ordering Information:------------------------------------------------------------------------------------------------------------------------------------------------------The Parker01 Robot can use two types of GumstixThis part can be bought online at Gumstix store : Gumstix basix 400xm-bt (with duck antenna) Gumstix connex 400xm-bt (with duck antenna) Figure 1: The Gumstix Controller Underside showing the Hirose connector and the processor. The front view as shown on the left shows the bluetooth "duck" antenna the bluetooth module and the MMC adapter. ===================================================================================
Features of Component:
------------------------------------------------------------------------------------------------------------------------------------------------------1. 400 MHz -(Intel XScale® PXA255)2. Multi-Media Card adapter to extend memory 3. 60 pin Hirose I/O connector 4. Supports UART, I2C, USB, NSSP and Bluetooth connectivity 5. Min voltage of 3.5V; Max Voltage 5V 6. 80mm X 20 mm 7. 64 mb onboard SDRAM 8. 1 MB onboard flash memory --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ===================================================================================Working of Component------------------------------------------------------------------------------------------------------------------------------------------------------This part of the guide describes how the Gumstix control board works. The communication protocols used by the Gumstix control board, setting up the environment for the Gumstixfor the different protocols is also described in this section. Detailed information is provided on a wiki site: http://docwiki.gumstix.org/index.php/Main_Page But the settings and working of the Parker01 are given in the documentation below: [Most of the information provided on this page is by Chang-Young Kim of Texas A&M University.] The Gumstix control board needs to be set-up to allow a computer to communicate with it to allow programs to be executed directly from it. Since the gumstix runs a linux environment we will focus mainly on interfacing with the Gumstix control board using a linux operating system. 1. Setting up the Computer: Using the Buildroot program 1.1. Opertating Systems 1.2. Getting the Buildroot System and Installing it 1.3. Communicating via Serial Communication in Linux: 1.4 Bluetooth Communcation on the Gumstix 1.5 Testing the Connection- USBNet in Linux 1.6 Communicating with the Gumstix using I2C 1.6 Sending Execution File to Gumstix 1.7. NFS support for Gumstix 1.8 Debugging with gdb 1.9 Adding NFS support to the gumstix 1.10 Using the the ubuntu computer. ------------------------------------------------------------------------------------------------------------------------------------------------------1. Setting up the Computer: Using the Buildroot program:------------------------------------------------------------------------------------------------------------------------------------------------------In order to setup the computer to talk to the Gumstix control board we use the Buildroot program provided by Gumstix. Buildroot is the method used by the Robotics Laboratory for the: Buildroot allows the construction of a custom, complete Gumstix filesystem in a single command. It automates all the tedious steps in constructing the image, including
The Buildroot also provides
configuration menus, which can be used to add software to the filesystem image
or remove existing packages. High level programming properties such as voice recognition and terminal
emulators can be utilized using checkboxes. ------------------------------------------------------------------------------------------------------------------------------------------------------1.1 Operating Systems:------------------------------------------------------------------------------------------------------------------------------------------------------Buildroot is primarily designed to be used on a Linux operating system.But it can be used on other Unix-like systems (like FreeBSD, Mac OS X, or Cygwin),
although maintaining it is more difficult The default Buildroot configuration works on Linux 2.6.x-based systems. For 2.4.x systems, see the Buildroot on Linux 2.4 page for tips. The Buildroot can be used on Windows by installing Linux in a virtual environment, such as VMware or Colinux, so that it runs in a window alongside your other applications. See the Buildroot on Windows page for details. See Buildroot on Ubuntu for a Howto on getting Ubuntu configured for building the Buildroot. See Buildroot on Dreamhost for a Howto on getting buildroot to build under your Dreamhost account. See Buildroot on MacOSX for a Howto on getting buildroot to build on an Apple Mac OS X machine. See Buildroot on SLED 10 SP1 for information on getting SLED 10 SP1 to build Buildroot. ------------------------------------------------------------------------------------------------------------------------------------------------------ 1.2. Getting the Buildroot System and Installing it
------------------------------------------------------------------------------------------------------------------------------------------------------
To use the Buildroot, you must obtain it from Gumstix's public Subversion repository. You will need the following things on your development host machine:
A browseable version of the repository can be accessed in your web browser by navigating to: http://svn.gumstix.com/gumstix-buildroot/trunk Use root as the user and root as the login. This will always be the latest
version of the gumstix Subversion repository. To get the current revision of the Buildroot, enter the following on your development host: svn co http://svn.gumstix.com/gumstix-buildroot/trunk gumstix-buildroot
If you want to get a specific revision XXX, use svn co -rXXX http://svn.gumstix.com/gumstix-buildroot/trunk gumstix-buildroot
The gumstix is shipped with something close to revision 773. The current revision is closer to 1200. These are NOT BINARY COMPATIBLE. This means that to use the buildroot toolchain to write programs without reflashing the operating system, you MUST USE svn co -r773 http://svn.gumstix.com/gumstix-buildroot/trunk gumstix-buildroot
This will create a new directory named gumstix-buildroot within your current directory. Using a version of buildroot which differs from the version of buildroot running on your gumstix, may result in segfaults or other errors which have nothinig to do with the program being run. For revisions of buildroot from 865 to the present, use: cd gumstix-buildrootmake defconfigmake
For revisions of buildroot earlier than 865, use: cd gumstix-buildrootmake
This will generate the initial Buildroot configuration files and start the process. This process is time consuming and the Gumstix website suggests that the user be be patient and allow the system to completely build the configuration files and systems. The build process will generate a lot of output, and you may see some error messages go by. Unless the build halts with a glaring error message, you can safely ignore them for now -- some application configuration scripts will try various approaches and choose the one that works. Final Step: If it succeeds, the build will
end with a line describing your shiny new root filesystem, which will be named The Buildroot scripts produce a JFFS2 filesystem image, suitable for loading directly onto the Gumstix's flash memory, but not -- by default -- usable from an MMC or CompactFlash card. The process for flashing the image onto the Gumstix is safe and easy. See the Replacing the filesystem image page provided by Gumstix for details. ------------------------------------------------------------------------------------------------------------------------------------------------------ 1.3. Communicating via Serial Communication in Linux:
------------------------------------------------------------------------------------------------------------------------------------------------------GumstixDocsWiki is the existing source from which this information is obtained.Before programming anything else, let's connect the Gumstix to your existing Linux machine. You need a terminal program such as Minicom or Kermit. To connect to the Gumstix console, you need a serial port, found on the tweener board or one of the waysmall expansion boards. You will also need a null modem cable with appropriate connectors. For more detailed information about serial connections, see the Serial adapters and Serial voltages pages. Fig[2] Serial and power connections to the Gumstix using the tweener board
Connecting with KermitThese directions are for the Kermit communications package (cKermit on Linux). 1. Connect the null-modem serial cable to the serial port on your computer and to the serial port on the Gumstix 2. Launch kermit with kermit -l /dev/ttyS0 where /dev/ttyS0 is the serial port you're using on the host computer. You may need to do this as root if regular users can't access the serial port. 3. The following configuration works when logging into the serial console: set speed 115200set reliablefastset carrier-watch offset flow-control noneset prefixing all
Add the following if you need to transfer files to the Gumstix (for example, when Replacing the filesystem image) set file type binset rec pack 4096set send pack 4096set window 5
4. Connect to the port by typing connect 5. Plug the power adapter into any power jack on the Gumstix. When connected and powered, you should see a message from U-Boot followed by the normal Gumstix boot sequence. 6. Log in for the first time with username root and password gumstix 7. When finished, you can return to the kermit prompt by typing [CTRL-\] then pressing c. Type quit to exit the program. Connecting with Minicom
Transferring filesTo send a file to the Gumstix:
To receive a file from the Gumstix:
------------------------------------------------------------------------------------------------------------------------------------------------------ 1.4. Bluetooth Communcation
------------------------------------------------------------------------------------------------------------------------------------------------------The Gumstix controller board can be used on a Bluetooth network and other networks using a TCP/IP based protocol. We shall focus on Bluetooth communicationas a Personal Area Network Node For other communication methods use the networking link: http://docwiki.gumstix.org/Networking Using the Gumstix Controller for Bluetooth communication works in both the Windows and Linux Environments --------------------------------------------------------------------------------------------------------System Currently In Use--------------------------------------------------------------------------------------------------------
On the Gumstix iface bnep0 inet static
Modify /etc/default/bluetooth changing only these items from the original: RFCOMM_ENABLE=false
/etc/init.d/S30bluetooth stop /etc/init.d/S30bluetooth start On the Linux machine Modify /etc/default/[bluetooth|bluez-utils]: PAND_ENABLED=1 PAND_OPTIONS="--listen --role GN" /etc/init.d/[bluetooth|bluez-utils] restart
ifconfig bnep0 192.168.1.1 -----------------------------------------------------------------------------------------------------The above method is different than the one prescribed by the Gumstix website. The information from the Gumstix Networking website regarding Bluetooth communication is given below:
On the Gumstix iface bnep0 inet static Modify /etc/default/bluetooth changing only these items from the original: RFCOMM_ENABLE=false /etc/init.d/S30bluetooth stop /etc/init.d/S30bluetooth start On your Linux machine Modify the bnep0 section of /etc/network/interfaces ommitting the gateway: mapping hotplug Modify /etc/default/[bluetooth|bluez-utils]: PAND_ENABLED=1 /etc/init.d/[bluetooth|bluez-utils] restart Now plug in your supported USB Bluetooth dongle and wait for your network to come up. On your Windows machine Using the BlueSoleil Software that may come with your USB Dongle. Install sofware and reboot. Plug in bluetooth dongle. Set network device to 192.168.xxx.1 Search for gumstix. Go to: My Services -> Properties -> Personal Area Network and turn off DHCP. The gumstix does not like the packet length of the DHCP. Go to: My Bluetooth -> Security Set the security level to Medium. Set the default passkey to for example [1234]. Restart the BlueSoleil software. Your gumstix should come up automatically.------------------------------------------------------------------------------------------------------------------------------------------------------ 1.5 Testing the Connection- USBNet in Linux
------------------------------------------------------------------------------------------------------------------------------------------------------This is the method prescribed by the lab users. The alternative methods to connect via USB is given at the following website http://docwiki.gumstix.org/index.php/Setting_up_USBnetIf everything works as expected you should have an usb0 interface (ifconfig -a) on both host (if Linux) and Gumstix after having plugged the USB-cable. From here on it's standard networking. If you are unfamiliar with Linux/Windows networks here some short lines to test your connection. Under Linux type "ifconfig", and look for adresses starting with 192.168.0.X. If you have some, replace 192.168.0.1 with 10.0.0.1 and 192.168.0.2 with 10.0.0.2 in the following lines (same applies for Windows: if you have already a network that uses 192.168.0.X, switch to another network): On the Gumstix (over serial line): # ifconfig usb0 192.168.1.2
On the linux-machine: # ifconfig usb0 192.168.1.1
And you should be connected to your gumstix over the usb-connection. Under Windows just configure the USB-interface to have 192.168.0.1 as IP-address. You can test the connection by httping to the gumstix (http://192.168.1.2). If you want to have a static IP on your gumstix edit /etc/network/interfaces on you gumstix and replace with iface usb0 inet static
Therefore the cleanest solution is to add a dhcp-server on the host-machine. You might also have a look at the Ethernet gadget page. ------------------------------------------------------------------------------------------------------------------------------------------------------ 1.6 Communicating with the Gumstix using I2C
------------------------------------------------------------------------------------------------------------------------------------------------------The I2C unit supports a fast mode operation of 400 Kbits/sec and a standard mode of 100 Kbits/secThe I2C bus uses 3 signals, SDA, SCL, and ground, all of which are present on the 60 pin hirose connector. Detailed information about the I2C communication is given at http://docwiki.gumstix.org/index.php/I2C_on_the_Gumstix Configuring the kernel for master/slaveBe sure CONFIG_I2C_PXA_SLAVE is set correctly in your buildroot's linux.config (set to 'n' if your Gumstix will be the master). If this changes, you will need to rebuild the kernel. Using precompiled modulesThe precompiled modules are specific to a version of the kernel. · 2.6.11 - i2c-modules-2.6.11.tar.gz · 2.6.15 - i2c-modules-2.6.15.tar.gz · 2.6.17 - i2c-modules-2.6.17.tar.gz · 2.6.18 - i2c-modules-2.6.18-pre-1143.tar.gz for versions of 2.6.18 prior to revision 1143. These versions used the SLOB version of kmalloc. · 2.6.18 - i2c-modules-2.6.18-1143.tar.gz for SVN revisions 1143 thru 1184. These versions used the SLAB version of kmalloc. · 2.6.18 - i2c-modules-2.6.18-1185.tar.gz for SVN versions 1185 and onwards. These versions use GCC 4.1.1 Copy the appropriate tarball to your gumstix. Let's assume you copied it into /tmp (ramdisk). Do the following to install the precompiled i2c modules: cd / tar xzf /tmp/i2c-modules-2.6.11.tar.gz Once you're happy that everything is working you can remove mod.dep, mod.sym, modules.symbols.org and modules.dep.org files. Building the modules from source1. Begin by getting a functional Buildroot running. 2. Enter the gumstix-buildroot/target/device/Gumstix/basix-connex (if you are using ether a basix or connex board) directory and edit linux.config (backing it up first...) Add the following lines in the appropriate place (hint: search for "I2C support"): # I2C support # CONFIG_I2C=m CONFIG_I2C_CHARDEV=m # # I2C Algorithms # # CONFIG_I2C_ALGOBIT is not set # CONFIG_I2C_ALGOPCF is not set # CONFIG_I2C_ALGOPCA is not set # # I2C Hardware Bus support # # CONFIG_I2C_ISA is not set # CONFIG_I2C_PARPORT_LIGHT is not set # CONFIG_I2C_STUB is not set # CONFIG_I2C_PCA_ISA is not set CONFIG_I2C_PXA=m or at your own risk use this linux-2.6.11.config or linux-2.6.15.config. You can also setup the i2c stuff through menuconfig: cd gumstix-buildroot/build_arm_nofpu/linux-* make ARCH=arm menuconfig For the 2.6.11 kernel, under 'I2C Support -->' set 'I2C Support' to <M>. Set 'I2C device interface' to <M>. Under 'I2C Hardware Bus support --->' set 'I2C interface in Intel PXA2x0' to <M>. Exit from menuconfig, saving your changes. The .config file will now contain the appropriate settings. You may want to copy this to gumstix-buildroot/sources/linux.config. For the 2.6.15 and newer kernels, under 'Device Drivers -->' goto 'I2C Support -->' and set 'I2C support' to <M>. Set 'I2C device interface' to <M>. Goto 'I2C Hardware Bus support' and set 'Intel PXA2XX I2C adapter (EXPERIMENTAL)' to <M>. Exit from menuconfig, saving your changes. The .config file will now contain the appropriate settings. You may want to copy this to gumstix-buildroot/target/device/Gumstix/basix-connex/linux.config. 3. If your buildroot is earlier than revision 767 (your < 767) (note: revision 767 is fairly old - Jan 25, 2006, so this only applies if you're using a really old buildroot), then you'll need to grab the 999-gumstix-i2c-bugfix.patch file and copy it into gumstix-buildroot/sources/kernel-patches . For newer versions of buildroot, the patch is either incorporated, or not required. 4. Remove the old kernel (while you're still in the linux directory). This will trigger the top-level buildroot to actually rebuild linux. rm arch/arm/boot/compressed/vmlinux 5. Run "make" at the gumstix-buildroot directory again to build the new kernel. 6. Copy the kernel and modules across or replace the filesystem image. Starting I2CBoot the gumstix and then "modprobe i2c-pxa" and "modprobe i2c-dev". Under 2.6.15, you should see some output like this: # modprobe i2c-dev i2c /dev entries driver # modprobe i2c-pxa I2C: i2c-0: PXA I2C adapter{CODE} Under 2.6.11, you should see some output like the following: # modprobe i2c-dev i2c /dev entries driver # modprobe i2c-pxa insmod: cannot insert `/lib/modules/2.6.11gum/kernel/drivers/i2c/i2c-core.ko': File exists (-1): File exists i2c_adapter i2c-0: found device 0x20 The warning about i2c-core.ko is really just saying that it can't load i2c-core for a second time (since it was already loaded when i2c-dev was loaded). You can automate this step at boot time, by adding the following lines to your /etc/modules file on the gumstix: # I2C i2c-dev The I2C bus should now be active. When you do the modprobe of i2c-pxa it will report all devices that are detected on the i2c bus (2.6.11 only). The device at entry 0x20 is an LTC1663 D/A that is used to bias the feedback voltage to the core voltage generator (LTC1878) (i.e. don't mess with it). It has not yet determined whether the 0x7e entry corresponds to a real device or not. ------------------------------------------------------------------------------------------------------------------------------------------------------1.7 Compiling the Source code on the cross compiling environment.------------------------------------------------------------------------------------------------------------------------------------------------------http://docwiki.gumstix.org/Sample_code/C/Hello_World This Makefile assumes that a directory is created parallel to the gumstix-buildroot (i.e. on the system in the lab,
gumstix-build root can be found at /home/dhylands/gumstix/gumstix-buildroot, so for the hello-world example, /home/dhylands/gumstix/dcb was created ). 2. Send the execution file to the gumstix. scp filename root@192.168.1.2:/root /root# ./filename------------------------------------------------------------------------------------------------------------------------------------------------------ 1.8 Debugging with gdb
------------------------------------------------------------------------------------------------------------------------------------------------------These tips are provided by Chang-Young of the Robotics Laboratory: In this example the program to be debugged is named ‘arm_executable’: * built the buildroot using ‘make’; * flashed the new rootfs to the gumstix; * ran ‘gdbserver localhost:2000 arm_executable’ on the gumstix; * ran gdb from directory ‘buildroot/toolchain_build_arm_nofpu/gdbclient-6.3/gdb/’ with options ‘-symbols arm_executable’ – i.e. ‘./gdb -symbols arm_executable’ * used command ‘target remote 192.168.1.103:2000’ in gdb, where 192.168.1.103 is the IP of my gumstix; * and everything worked!
------------------------------------------------------------------------------------------------------------------------------------------------------1.9 Adding NFS support to the gumstix------------------------------------------------------------------------------------------------------------------------------------------------------see also Root filesystems#NFS Root Below are the steps required to generate a root filesystem with NFS support. Adding RPC support into uClibc Adding NFS support into the kernel Adding NFS mount support to busybox ------------------------------------------------------------------------------------------------------------------------------------------------------1.10 Using the the ubuntu computer.------------------------------------------------------------------------------------------------------------------------------------------------------First install the necessary packages from your local repository. Aptitude may be switch with apt-get for a _less then modern_ installation. 1. sudo aptitude -P install nfs-kernel-server nfs-common portmap When configuring portmap do =not= bind loopback. If you do you can either edit /etc/default/portmap by hand or run: 1. sudo dpkg-reconfigure portmap If you have edited the file by hand you can restart portmap via: 1. sudo /etc/init.d/portmap restart Note: It is not necessary to install NFS on client machines which are not going to be sharing any of their own directories. Sharing Local Folders1. mkdir /root/gumstix_shareTo specify a folder you will need to edit /etc/exports, which can be done like (replace vi for your favorite editor): 1. sudo vi /etc/exports For an example I will share, with full read/write and privileges, my temporary directory. This directory will be broad casted to every local IP from 192.168.1.1 through 192.168.1.255. 2. /root/gumstix_share 192.168.1.1/24(rw,no_root_squash,async) Mount command on the gumstix.mount -t nfs -o nolock 10.1.1.1:/root/gumstix_share /mnt/nfs |