That SR created by stephan.knecht@bones.ch with subject "Strange USB behavior regarding BlockSize and DataSize".
I copy the response in that SR below:
------------------------------------------------------------------------------------
I cannot really make much sense of it all.
The queue head indicates that the dTD is active and nothing has been transferred (total byte count is 0x800, active flag is set, no error flags.
The protocol log shows 1 512 byte packet was transferred and acknowledged, so byte count should have been reduced with 0x200.
If the ACK would not have been seen by the controller, then the byte count would not have been reduced, but the controller than re-transmit at the next IN, which does not happen either.
The controller responds with NAK after the first 512 bytes have been transferred, which means the endpoint is not primed. This does not make sense because the endpoint auto-primes once the transfer has started (i.e first packet is started).
So I think the software does not correctly handle adding/removing dTDs from the queue.
One strange thing is that the initial queue head has address 0x6320 as current dTD, which is the same address as the queue head that is being added. This can be an indication that the same qTD is re-used for consecutive transfers and that may lead to timing issues (race conditions) between controller and software.
I recommend to always use an new dTD and link it to next-dtd in the queue head when adding a qTD to an active queue.
Please refer to the USB driver in Platlib. The driver library has an example on how to manage dTDs on a queue head.
Also, the i.MX5x reference manuals have more details on how to manage device queue heads. Please refer to these for more details.
____________________________________________