I develop HID devices on TM4C129x with TivaWare USB library (Ver 2.1.0).
I am troubled by issue of USB re-connection.
When USB cable is disconnected in the middle of data communication, Tiva USB driver is not recognized by Host-PC after that.
The following is the detailed sequence:
- Connects my device to Host-PC with a USB cable.
- Host-PC recognizes my device as USB HID device.
- Starts many control transfer operation from Host-PC to my device.
- Disconnects the USB cable in the middle of data transmission directly.
- Connects the USB cable from Host-PC to my device again.
- Host-PC does NOT recognize my device. (Host-PC reports unknown device error)
(If USB cable is disconnected after data transmission finished, Host-PC recognizes my device again.)
In Step 5:
TivaWare USB Library catched USB_INTCTRL_RESET, USB_INTEP_0 and some events.
However, USBLib's iEP0state(*) remaining in "eUSBStateRx", therefore EP0 request was not processed and Host-PC did not recognize my device.
(*) "g_psDCDInst[0].iEP0State" in "usbdenum.c".
I think iEP0State should be initialized on USB_INTCTRL_RESET event handler.
However I cannot judge whether it is right fix.
Should I call some usblib's function on my driver's reset handler ?
Or is event handing incomplete?