HOWTO Configure Eclipse to Work with Jowles
Introduction
This "HOWTO" guide describes how to configure Eclipse on a Xubuntu 7.10 development workstation to:
- compile 'C' code for the ARM toolchain
- automatically install the compiled code onto a test GumStix based myPhone, and
- use remote debugging so you can debug code on the GumStix system in the graphical Eclipse environment on the development workstation.
We assume you've already:
- assembled your GumStix / Goliath or GumStix / ConsoleLCD based myPhone
- installed Linux on your development workstation (or are running it as a VMWare virtual image)
- connected the myPhone to the development workstation using a serial cable
- downloaded, compiled and installed a recent buildroot from GumStix, and
- can successfully log into the myPhone via Minicom (or a similar terminal emulator)
Options
This HOWTO assumes you're connecting to your GumStix device via the serial cable. We're going to configure PPP over this serial link so we can use ssh, scp and sftp to make a "network" connection to the device. Using the serial cable is convenient because if you're going to be flashing new images onto your GumStix device, you're already going to need to access the console via the serial port. So we assume that you already have the appropriate null modem cable and are writing this HOWTO to use PPP over the serial port since this is the configuration that requires no hardware beyond what we think is typical for a myPhone developer.
Some people will have added WiFi or Ethernet adapters to their devices, and there's no reason you can't use these high speed network devices instead of the relatively slower serial PPP link described here. However... if you want to do this, you'll have to make the appropriate changes to the procedure described below.
Configuring PPP
If you have a WiFi or Ethernet connection to your GumStix device, you won't need to do this step.
Manual Connection
Fortunately, PPP is preconfigured for both the gumstix and Xubuntu 7.10. All you have to do is launch the pppd daemon on both sides of the connection. The simplest way of doing this is:
- replace the stock
/etc/ppp/options
file on your Xubuntu 7.10 development host with the one available at http://www.hbmobile.org/downloads/XU710_HBMOBILE003/options.mobo. - Use minicom to connect to the gumstix. You should be able to login to the root account using the gumstix password.
- launch the pppd daemon on the gumstix with the command
pppd
. - quit minicom without resetting the connection (with the Ctrl-A Q sequence.)
- launch the pppd daemon on the Xubuntu development host with the command
/usr/sbin/pppd /dev/ttyS0 192.168.3.1:192.168.3.2
Automatic Connection
Another way to manage this is to have the ppp daemon automatically launched at boot time. Note that the daemon will displace the getty that allows you to login via the serial port. But this shouldn't be too big of a deal because a) if PPP is functioning correctly, you'll be able to use ssh to get a login prompt and b) you can always connect a USB keyboard to the gumstix's USB port and login that way.
The advantages of using PPP are that you can use the ssh, scp and sftp commands to log into or copy files to or from the gumstix. Additionally, the Eclipse plugin that allows you to do remote device management requires SFTP to be working.
Download the Script for the Gumstix
I put together a quick script that can be run on the gumstix device to start PPP:
#!/bin/sh
if [ ! -c /dev/ppp ] ; then
/bin/mknod /dev/ppp c 108 0
fi
/usr/sbin/pppd 115200 /dev/ttyS0
/bin/sleep 5
Or you can download this script from http://www.hbmobile.org/downloads/XU710_HBMOBILE003/do_ppp.gumstix .
For the purposes of this HOWTO, let's assume you put this script in the /usr/bin
directory.
Modify the /etc/inittab file
In order to replace the getty that launches automatically on /dev/ttyS0, you'll have to comment out the following line in /etc/inittab (on the gumstix):
null::respawn:/sbin/getty -L ttyS0 1115200 vt100
and add the line:
null::respawn:/usr/bin/do_ppp.gumstix
Then execute the /sbin/reboot
command to reboot the system.
Launch ppp on the development host
Now that the gumstix device is configured to run pppd automatically, you can run the following command on the Xubuntu development host:
sudo /usr/sbin/pppd 115200 /dev/ttyS0 192.168.3.1:192.168.3.2
This should setup a PPP link between the gumstix and the Xubuntu development host with the gumstix's IP address being 192.168.3.2
.
Configure OpenSSH and Dropbear
Before you can use the Eclipse tools to automatically distribute code to the gumstix, you have to get SFTP working. You could try the command:
sftp root@192.168.3.2:/
but you would likely get an error. The reason for the error is the default configuration for dropbear is that it doesn't support SFTP. So, we'll have to use the patch packages from http://razzle.dk/. The easiest way I found to use them was to download them, untar them, and then remake the root image. So assuming you put your gumstix-buildroot
in the ~/Projects
directory, the commands would look something like this:
cd $HOME/Projects/gumstix-buildroot/package
wget 'http://razzle.dk/gumstix/package/dropbear.tgz'
wget 'http://razzle.dk/gumstix/package/openssh.tgz'
tar xzvf dropbear.tgz
tar xzvf openssh.tgz
cd ..