USB Tx slow for a large block of data

Discussion created by lpcware Employee on Jun 15, 2016
Content originally posted in LPCWare by pra18 on Wed Dec 10 09:59:10 MST 2014
problem in Tx


I am trying to implement Tx on a USB Virtual COM for the support of physical layer of an application layer protocol in my custom board.

It is a lpc4357 and uses USB1 on it.

I am not having any problem when it comes to transmitting a single byte over the USB or perhaps shorted frames of data.

But the problem occurs when I try to send large block of data of say 177 records . There are delays in between say it transmits 27 records and
then there is a delay for a short while. after that it again transmits another 30 records. It takes some time like this and finally achieves a full transfer

This problem does not exist for short frames however.

Whereas, the Application layer is doing many retries in this period and is not acceptable to wait because the block of data should be sent as fast as possible and
a callback notification goes to the application layer that the transfer was completed.

If this callback is not signalled in time, the application layer does many retries but the low level USB pauses for a while and at its own convinience transmits next block of data

Is the application layer doing retries very fastly before the USB Tx is done ?

Can anyone point out where exactly the problem could be? Can it be that 64 bytes is max. packet length and it sends 64 bytes at once and then during the next EP IN interrupt
the handler services the interrupt and then another 64 bytes are being sent using WriteEP call ?

Thanks in advance,