Tuesday, January 10, 2006

Crosscompiling for GP2X

I was playing for some time with cross-compiling GNU utilities for my GP2X. I followed this interesting article on GP2X Wiki about preparing development environment based on OpenEmbedded. It is supposed to make it easier to compile packages for proper architectures of embedded devices called OpenEmbedded. It took some time to properly set it up (the project doesn't have `official' documentation, only a wiki), but I got it working properly, i.e. it produces packages (yet another packaging format - ipkg, `Itsy package') that can be installed and uninstalled easily. This means that various packages that can be found on `normal' (i.e. not embedded) systems, so now we can port... Emacs?! :-)

I have also managed to get terminal emulation via USB cable working, so that I can use minicom (or any other terminal emulation software, like Windoze's HyperTerm) to talk directly to a device present on GP2X. There is ready shell script that you need to run from GP2X, which creates (if it's not already there) proper device in /dev, loads USB Gadget kernel module and starts shell with stdin and stdout pointing to abovementioned device. Now, all you need to do on your workstation side is to load USB ACM modem module (which is called 'cdc-acm' on my system) unless hotplug subsystem didn't do it for you and start up properly configured minicom.

Here's 'USB shell start script' run from GP2X:


rm -f *.txt


mknod /dev/ttygs0 c 127 0

insmod /lib/modules/2.4.25/kernel/drivers/usb/gadget/net2272.o
insmod g_serial.o use_acm=1


sleep 3

/bin/bash --login --noprofile -i -s < /dev/ttygs0 > /dev/ttygs0 2>&1 &

cd /usr/gp2x

USB Gadget code is availabe here.


Post a Comment

<< Home