Giovanni wrote:The transmission is split in "transactions", the driver cannot push the packets of the next transaction in the TXFIFO until the previous transaction is over and the application submits the next transaction buffer.
So the worst between FIFO size and transaction size is what limits the usable bandwidth.
I don't think there is a workaround for this, it is how the USB peripheral works (and may be intrinsic to the USB protocol).
Giovanni
As far as I understand, the transaction buffer is something related to the driver, while the TxFIFO is related to the hardware.
I can see that the driver code does not allow a new transaction to be started until the previous is ended, but what I understand from the RM0090-Reference manual p1054 is that the Transfer size can be larger than the TxFIFO as long as the TxFIFO is long enough to contain more 2 or more packets, and that the application (driver) writes data into the TxFIFO when it starts to deplete. (The following is something I have read somewhere else in the reference manual). The OTG hardware will continue to transmit packets as long as transfer size is not counted down to 0, and the TxFIFO contains at least one full packet. If the TxFIFO contains less data than a full packet while there are more data to be transmitted (according to the transfer size), it will be sent, and the transaction will be continued in the next frame.
As far as I understand, this is exactly what the "Half empty" interrupt is for. To enable the driver to refill the TxFIFO in the middle of a transfer, and by that ensure that there is always at least a full packet present in the buffer when the previous packet is finished.
Kjell