Quantcast
Channel: Processors forum - Recent Threads
Viewing all articles
Browse latest Browse all 17527

How to flush C6748 USB CDC Device TX data?

$
0
0

Dear All,

I encounter a strange problem when I'm trying to make my C6748 USB Composite (HID + CDC) Device to send 1M byte of data to windows 7 Host from the CDC device. Most of the data are transmitted smoothly and fast, however, Host always waits for the last few hundreds of bytes from Device.

I've listed the code snippet as following:

USBBufferWrite ((tUSBBuffer *) &g_sTxBufferCDC,(unsigned char *) g_ullDataBlock,ulWrtLen);

usSerialState = USB_CDC_SERIAL_STATE_TXCARRIER | USB_CDC_SERIAL_STATE_RXCARRIER;

USBDCDCSerialStateChange ((void *)&g_sCDCDevice, usSerialState);

 

It seems that the last part of data is simply kept in queue. Therefore, I tried to append the following line of code to the code snippet above, but it doesn't make any difference:

USBFIFOFlush (USB0_BASE, USB_EP_1, USB_EP_DEV_OUT);

Maybe I should use some other function?

I'll appreciate if anyone could advise!

Regards,

Oliver


Viewing all articles
Browse latest Browse all 17527

Trending Articles