Tool/software: Code Composer Studio
HI TI,
tm4c123xgl, usb_host_cdc, ui32Interval
I am working on USB_HOST_CDC, thanks for the previous thread e2e.ti.com/.../.
Now TM4C123XGL can send data to device through USB BULK_OUT endpoint, which I am able to monitor on a PUTTY terminal connected to the device UART port.
The device has been programed to echo back all the data received from host. However, TM4C123XGL has trouble to read data from USB BULK_IN endpoint.
I followed usbhhid.c, which reads out packets using USBHHIDGetReport(), in which the packet is actually read out by USBHCDPipeReadNonBlocking(). Therefore, I wrote
uint32_t USBHCDCGetChars(unsigned char *pucData, uint32_t ulSize)
{
uint32_t Size;
Size = USBHCDPipeReadNonBlocking(g_USBHCDCDevice.ui32BulkInPipe, pucData, ulSize);
return(Size);
}
The problem is TM4C123XGL only collected portion of the data. According to USBHCDPipeConfig (also defined in usbhostenum.c like USBHCDPipeReadNonBlocking) value of ui32Interval for Bulk ranges within [2 - 16], which actually is the interval when TM4C123xgl host can read data from BULK_IN endpoint. For example, if setup ui32Interval=2, USBHCDPipeReadNonBlocking will obtain every odd sets of data, and for even sets just return 0; while setup ui32Interval=8, it will only get 1 from every 8 sets of data.
Please advise, thanks in advance.
Mike