Gumstix Development Environment

Development PC

Getting the development host computer to network with the Gumstix took some work. According to: http://www.gumstix.org/tikiwiki/tiki-index.php?page=Tutorial section “USBNet under Linux”, the development machine must be running the Linux kernel 2.6.10 or newer to work with the Gumstix. When compiling the kernel make sure when doing “make menuconfig” that Device Drivers -> USB Support -> USB Network Adapters -> Embedded Arm Linux Links (CONFIG_USB_ARMLINUX) is selected

Also under Device Drivers -> USB Support -> USB Gadget Support

The following are selected: Support for USB Gadgets, USB Gadget Drivers (Ethernet Gadget), Ethernet Gadget, and RNDIS support are selected. I selected them to be included in the kernel, not as modules. I do not know if this makes a difference.

There is a patch for the 2.6.9 kernel, but the kernel which is to run on the Gumstix must be recompiled and installed to not include RNDIS support, this will make it so the Gumstix cannot communicate via a USB network connected to a Windows box.

Make sure that when you are booting up the desktop, the gumstix is plugged into the desktop via the usb cable. If not, then the kernel will not load the drivers for the Ethernet Gadget.

Compiler Collection, Kernel and File System



The gumstix-buildroot http://www.gumstix.org/ package was compiled. This compiled the GNU compiler collection version 3.4.2 which is compatible with the default installed Gumstix installed libraries. To use the compiles on the development box simply add to the front of the PATH variable the location of the arm-linux-* executables. For example:


export PATH=/home/mtang/gumstix/gumstix-buildroot/build_arm/staging_dir/bin/:$PATH


When I ran make, for a couple of files it was unable to download the sources because it could not find some of the servers. This was easily fixed by editing the server URLs in the appropriate make/*.mk files.


The next procedure is a little different from the one found at: http://www.gumstix.org/tikiwiki/tiki-view_forum_thread.php?forumId=3&comments_parentId=101


When make is done, the file root_fs_arm is left in the gumstix-buildroot directory. To install it on the gumstix start minicom, setup the serial port. MAKE SURE minicom's modem init string is null or blank, same with the reset string. If it is not then the gumstix will probably not boot. Restart minicom, then power up the gumstix.


When you see “"Hit any key to stop autoboot:” press a key.


Then:


GUM> loadb a2000000


Exit minicom, change to the gumstix-buildroot directory and type 'kermit'

In the kermit command prompt type:


'set prefixing all'

'set file type binary'

'set parity none'

'set carrier-watch off'

'set line /dev/ttyS0'

'set speed 115200'

'send root_fs_arm'

'quit'


start minicom again and do the following:


GUM> era 1:2-31

GUM> cp.b a2000000 40000 ${filesize}

GUM> fsload a2000000 boot/uImage

GUM> bootm a2000000



Remote Debugging


Have the development NFS mounted on the Gumstix.


For example:

# mount -t nfs -o ro,rsize=8192,nolock,intr,udp 192.168.2.1:/opt /mnt/oolong/


All of the mount flags are required so that the NFS is mounted fast. If they are not provided then it might take a while for the mount to complete.


Setup remote login and execution to the Gumstix:

http://openzaurus.org/wordpress/howto/passwordless-ssh/


Download and extract the gdb sources. At the time of writing this the current version is 6.3 from the GNU website.


$tar xzvf gdb-6.3.tar.gz
$cd gdb-6.3/gdb/gdbserver
$chmod 777 configure
$CC=arm-linux-gcc ./configure arm-linux
$make

$cd gdb-6.3 (the root directory of the gdb source code)
$./configure --host=i686 --target=arm-linux
$make


It is required the arm-linux-* executables are still in your path. under gdb-6.3/gdb copy the gdb executable to the same directory as the arm-linux-* executables, but rename it to arm-linux-gdb.


A lot can be done with shell scripts and gdb scripts. It is possible to start a desired program on the gumstix, fire up ddd by executing one shell script. But details on this will not be provided.


Now that the tools are installed, an example of remote debugging:


Create a simple program to debug and compile it:


arm-linux-gcc -c -g3 -O0 remotedebugtest.c

arm-linux-gcc -o remotedebugtest -g3 -O0 remotedebugtest.o


On the gumstix mount the NFS like this:


# mount -t nfs -o nolock 192.168.2.1:/opt/ /mnt/oolong/


On the development machine do the following:


$ssh root@192.168.2.2 'gdbserver :1234 / mnt/oolong/test1/remotedebugtest' &

[5] 27186

[mtang@oolong test1]$ Process /mnt/oolong/test1/remotedebugtest created; pid = 1647

Listening on port 1234


$ arm-linux-gdb remotedebugtest


Notice how gdb cannot find some libraries. The libraries it is looking for are the ones on the gumstix.


To fix this copy the gumstix libraries to a directory on the development machine or mount a NFS volume. I put the gumstix libc.so.0 and ld-uClibc.so.0 in /home/mtang/gumstix_lib on the development PC.


Create a .gdbinfo file in the same directory as your executable on the development PC and give it contents like the following:


target remote 192.168.2.2:1234

break main

set solib-search-path /home/mtang/gumstix_lib

continue


Now gdb will work correctly:


$ ssh root@192.168.2.2 'gdbserver :1234 / mnt/oolong/test1/remotedebugtest' &

$ arm-linux-gdb remotedebugtest


You can use ddd if you want a gui:


$ ssh root@192.168.2.2 'gdbserver :1234 / mnt/oolong/test1/remotedebugtest' &

$ ddd --debugger arm-linux-gdb --gdb remotedebugtest