Control IN transfer fails when the response size is multiple of packet size. | Cypress Semiconductor
Control IN transfer fails when the response size is multiple of packet size.
FX3 Control IN request fails when the response size is:
- multilpe of the packet size (64, 128, 192.. for HS, 512, 1024, 1536.. for SS)
- smaller than wLength (if response size equals wLength, no problems occur)
The error occurs in PC side (ex, Control Center shows error 997)
but in the firmware side, CyU3PUsbSendEP0Data() returns no error.
I guess, in this situation, the last ZLP may be lost.
In Setup Request callback, calling additional CyU3PUsbSendEP0Data() with 0 bytes length
hides this problem, like this:
CyU3PUsbSendEP0Data( bytes, buf );
if( (bytes % glPacketSize) == 0 )
This workaround code is Appropriate？
I attach test project.
This firmware accepts Vendor-IN Request, and response [wValue] bytes.
If wIndex is 1, the workaround is enabled.