Hi,
I have modified the usb_dev_serial example and removed the redirected link through UART0. I am able to sending and receive data through the CDC USB link very much like the usb_dev_bulk example. When I run the modified usb_dev_serial example, the log of usb control/received/transmit events reported by the callback handlers shows that the USB buffer is received data (19 bytes in total) on the TM4C123GXL while the host is not sending any data. Here is the log of events, where Ct, Rx, and TX respectively denote the event reported by the ControlEventHandler, RxEventHandler, and TxEventHandler. Moreover, Rx: 0, Rx: 2, -> 2 corresponds to previous total of received bytes, new total of received bytes, and their difference. I could not understand what to do with this received data when it is not sent by the host application.
Tiva C Series USB Serial Device Example
--------------------------------------------------------
Configuring USB
Waiting for host...
Ct: USB_EVENT_SUSPEND
Ct: USB_EVENT_SUSPEND
Ct: Connected
Rx: USB_EVENT_DATA_REMAINING
Ct: USBD_CDC_EVENT_SET_CONTROL_LINE_STATE
Rx: USB_EVENT_DATA_REMAINING
Ct: USBD_CDC_EVENT_SET_LINE_CODING
Rx: USB_EVENT_DATA_REMAINING
Ct: USBD_CDC_EVENT_SET_CONTROL_LINE_STATE
Rx: USB_EVENT_DATA_REMAINING
Ct: USBD_CDC_EVENT_SET_LINE_CODING
Rx: USB_EVENT_DATA_REMAINING
Ct: USBD_CDC_EVENT_SET_CONTROL_LINE_STATE
Rx: USB_EVENT_DATA_REMAINING
Ct: USBD_CDC_EVENT_SET_CONTROL_LINE_STATE
Rx: USB_EVENT_RX_AVAILABLE
Rx: USB_EVENT_RX_AVAILABLE
Rx: 0, Rx: 2, -> 2
Rx: USB_EVENT_RX_AVAILABLE
Rx: 2, Rx: 3, -> 1
Rx: USB_EVENT_RX_AVAILABLE
Rx: USB_EVENT_RX_AVAILABLE
Rx: 3, Rx: 5, -> 2
Rx: USB_EVENT_RX_AVAILABLE
Rx: 5, Rx: 6, -> 1
Rx: USB_EVENT_RX_AVAILABLE
Rx: USB_EVENT_RX_AVAILABLE
Rx: 6, Rx: 8, -> 2
Rx: USB_EVENT_RX_AVAILABLE
Rx: 8, Rx: 9, -> 1
Rx: USB_EVENT_DATA_REMAINING
Ct: USBD_CDC_EVENT_SET_CONTROL_LINE_STATE
Rx: USB_EVENT_DATA_REMAINING
Ct: USBD_CDC_EVENT_SET_CONTROL_LINE_STATE
Rx: USB_EVENT_DATA_REMAINING
Ct: USBD_CDC_EVENT_SET_LINE_CODING
Rx: USB_EVENT_RX_AVAILABLE
Rx: 9, Rx: 14, -> 5
Rx: USB_EVENT_RX_AVAILABLE
Rx: 14, Rx: 19, -> 5
The above events happened in the setup where Debug usb cable was connected with a PC running Windows 7, whereas Device usb cable was connected with a PC running Ubunt 14.04. However when I connected both cables to the PC running windows 7, I noticed following events.
Tiva C Series USB Serial Device Example
--------------------------------------------------------
Configuring USB
Waiting for host...
Ct: USB_EVENT_SUSPEND
Ct: Connected
Ct: USBD_CDC_EVENT_GET_LINE_CODING
Rx: USB_EVENT_DATA_REMAINING
Ct: USBD_CDC_EVENT_SET_CONTROL_LINE_STATE
In this case, no 'USB_EVENT_RX_AVAILABLE' event is reported by the CDC Driver class, unless there is transmitted data from the host to the board. Could anyone explain why this happening?