Hello All!
I am trying to transfer sensor sample readings from a Tiva launchpad + senshub booster pack to an android device. I was hoping to run the usb serial example provided in the tivaware 2.01 release on the microcontroller, and make use of the USB host libraries on the android device to communicate between the two. It looks like they should almost fit together, but I've run into a problem.
When I tried to send a control transfer to the TIVA to set the UART properties (to test the example), the TIVA board starts spamming NULL characters through the debug USB port. It looks like the TIVA driver is interpreting the control transfer as a data transfer instead. Either screwing up the ring buffer read / write indexes so the program is chasing itself around the ring buffer printing an infinite stream of "received" NULL characters, or perhaps not triggering the proper ACK so the host is repeatedly sending the control transfer that the TIVA board continues to misinterpret.
After hunting through the TIVAWARE drivers I came across this fun tidbit: (in usbdcdc.c)
"2. The CDC specification is very clear on the fact that an ACM device
// should offer two interfaces - a control interface offering an interrupt IN
// endpoint and a data interface offering bulk IN and OUT endpoints. Using
// this descriptor configuration, however, Windows insists on enumerating the
// device as two separate entities resulting in two virtual COM ports or one
// COM port and an Unknown Device (depending upon INF contents) appearing
// in Device Manager. This implementation, derived by experimentation and
// examination of other virtual COM and CDC solutions, uses only a single
// interface combining all three endpoints. This appears to satisfy
// Windows2000, XP and Vista and operates as intended using the Hyperterminal
// and TeraTerm terminal emulators. Your mileage may vary with other
// (untested) operating systems!"
So if I had to hazard a guess, I'd say the Android function calls are actually implementing the standard properly, and trying to interact with two separate interfaces, while the drivers have a "trick" for windows to make the two interfaces look like one. Problem is I can't find this trick!
Is there a way to disconnect the two interfaces in the example to see if it behaves nicer with the Android library calls? If not, I don't actually need the control interface for anything, I just want to move sensor values from A to B... would there be any consequence from just ignoring the control interface completely and using bulk transfers to / from the example? Does the driver expect (or require) any communication on the control interface to function? There are a lot of ways for the driver to STALL the endpoint and I'm not too sure how a host is supposed to clean that up yet...
My part is TM4C123GH6PM (rev1 I believe), and the example is usb_dev_serial from: C:\ti\TivaWare_C_Series-2.0.1.11577\examples\boards\ek-tm4c123gxl\usb_dev_serial
Thanks a lot!
Michael