USB Networking with Gumstix OverosLast Updated on Saturday, 27 November 2010 20:55 The OTG USB port on the Overo expansion boards support USB networking. To enable this, the OTG port needs to be configured as a USB peripheral or gadget. The default kernels from Gumstix have the OTG port configured to act as a USB host. This comes from a how-to I posted in the USB section of the Gumstix Users Wiki. The procedure for changing the configuration requires rebuilding your kernel, so you should first be comfortable with setting up a build environment and building images for your Overo. The following steps assume you are using a recent snapshot of the gumstix-oe git tree and are going to use kernel version 2.6.31 or greater. The gumstix recipes for these kernels has a variable that allows you to specify how you want the OTG usb port configured. Gumstix Overos use the linux-omap3 kernels by default. You can check which kernel version you'll be working with like this: $ cd ${OVEROTOP}
So the recipe file in this case would be ${OVEROTOP}/org.openembedded.dev/recipes/linux/linux-omap3_2.6.34.bb. You'll see a line in there MUSB_MODE ?= "host" There are three valid values for MUSB_MODE: "host", "peripheral" or "otg". You could change the MUSB_MODE assignment directly in the recipe, but a better way to do this is to modify your local.conf file and add a MUSB_MODE variable. The ?= assignment means "host" will be assigned to MUSB_MODE only if it does not already have a value which it will if you give it one in local.conf. The local.conf file is found here ${OVEROTOP}/build/conf/local.conf Add the line MUSB_MODE = "peripheral" or MUSB_MODE = "otg" depending on your preference. Now rebuild your kernel. $ cd ${OVEROTOP}
And then rebuild your rootfs since the drivers available in /lib/modules will have changed. $ bitbake omap3-console-image Change omap3-console-image to whatever image you use. Once you have booted the new system, you still need to load the g_ether driver since it was built as a module. You can add g_ether to /etc/modules if you always want it to load at boot. root@overo# modbprobe g_ether root@overo:~# ifconfig -a Configure the usb0 interface the way you would any other. For example root@overo:~# ifconfig usb0 192.168.20.2 netmask 255.255.255.0 If you then plug the usb OTG cable into a host computer ready for usb networking you'll get a console message g_ether gadget: high speed config #1: CDC Ethernet (ECM) The rest is all standard Linux networking.
|
Gumstix USB networking