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:
Example gadget code:
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:
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:
And Windows USB host example code here:
http://www.lvr.com/serport.htm (use for USB virtual serial port)