[beagleboard] USB drivers

Does anyone have experience with windows or linux USB drivers for BeageBone (PC operating as host) for communication purposes? To be a bit more specific, I am trying to grab data through USB and graph it on a GUI in real time (which means maximizing the communication speed).

You'll need to:

1. Decide which of USB's four transfer types (control, bulk, interrupt, isochronous) fits your application's needs.
2. Pick a host driver that supports that transfer type.
3. Provide BeagleBone code that knows how to communicate with the driver.

If you can use something close to real time, interrupt transfers might work. Interrupt transfers have guaranteed maximum latency (time between bus transactions) but not a guaranteed delivery rate. For example, if the device endpoint requests a max latency of 1 ms, the host may poll the endpoint at that rate or faster. Bus errors and host overhead can delay data in some cases.

The USB spec says the most a default interface should request for interrupt endpoints 64 bytes / 125 microsec., which works out to 512kbytes/sec (high speed only). For greater throughput, you'll need a host driver that supports selecting an alternate interface.

Isochronous transfers can provide greater throughput with a guaranteed delivery rate, but no error correcting so this probably isn't what you want for data.

Bulk transfers have no guaranteed bandwidth or timing but can transfer the most data on an otherwise idle bus, so this might work if you control what devices are attached and don't need a guaranteed delivery rate.

Control transfers have no guaranteed timing and are less efficient than interrupt or bulk transfers.

For device code, the Linux gadget driver supports many USB device functions:

http://www.linux-usb.org/gadget/

Example gadget code:

http://www.linux-usb.org/gadget/usb.c

The example is for bulk transfers, but generally, device code for bulk and interrupt transfers is the same except for the endpoint descriptors.

A host PC can use libusb to access a gadget device:

http://www.libusb.org/

Another option for interrupt transfers is a generic HID (human interface device) class device.

Options for bulk transfers include a USB virtual serial port, mass storage, and Ethernet bridge.

I have Linux USB host example code here:

http://www.lvr.com/beagleboard.htm

And Windows USB host example code here:

http://www.lvr.com/hidpage.htm
http://www.lvr.com/winusb.htm
http://www.lvr.com/serport.htm (use for USB virtual serial port)

Jan

Since Jan won’t say it herself- pick up a copy of her new USB Embedded Hosts book. This book is based on BB-xm and well worth the money. If you want to learn about USB in general, her USB Complete book is a great choice.

Thanks Jan for your helpful reply. I was looking through the USB transfer types and and it seems like achieving a certain latency is a lot easier than getting error free and accurate data. In my application, I look for a triggering point and I collect data for a certain time before and after that. Therefore, if data is not error free, I might miss the triggering point. Any suggestion on what transfer type might work better?
Thanks,
Nazanin