Our embedded linux system won't recognize a USB Device if it is plugged in before powerup. Suggestions?
Bringing this back from the dead for completion.
The details are fuzzy, but as it turns out the device itself was crashing on boot. I believe it had to do with uBoot generated chatter on the USB line. Essentially, uBoot polled all hardware lines (including USB) to find a bootable image. This polling should be harmless, but the firmware on our USB device couldn't handle it and crashed immediately, rendering it inoperable until a hard reset (physically unplugging the device and plugging it back in).
We did report this bug to the device manufacturer but we received no indication that the fix for the problem (that apparently only affected us) would be a priority, so we resorted to a $.50 fix.
The way we solved this was pretty creative, but worked flawlessly. We built a simple GPIO controlled relay and spliced the USB power line through this relay. Essentially, the system booted up with the relay "off", and hence no power to the USB devce. The system booted up normally, and in our startup script we simply toggled the GPIO line to activate the relay. The USB device was free to boot up normally, with no interference from uBoot.
It sounds as though the device tried to chat with the OS on first boot and since the stack wasn't ready at that time, it "logged out" from the hub. Consider adding a section to the end of boot process to drop the driver and to force a reload. (modprobe -vr ehci_hcd; modprobe -v ehci_hcd
if USB2.0, uhci_hcd
if USB1.x)
Another possibility is that when the Gumstix shut down, it told the device to go into power-saving mode which may be improperly supported by the device. Windows may do things different there than Windows which may be all that the vendor tested on. To test this, you may have to tell the device driver not to suspend or power off devices during system restarts. Look at the Linux Kernel Documentation on Power Saving in the USB section to get started.