Hello, Im using code form a usb ccid example. I have a problem with usb messages whose length is a multiple of 64, which is the maximum size of a usb fs packet for bulk out message. I guess the problem may be related to the USB_DeviceKhciInterruptTokenDone function. TransferLength is 272 bytes each time, which is related to USB_DEVICE_CONFIG_CCID_MAX_MESSAGE_LENGTH defined in the usb_device_ccid.h file, which im my opinion causes whole problem. When we send a USB message with an example length of 128 bytes, the device will expect that the next message fragment will arrive because the variable remainingLength != 0. If the packet is >64 but not a multiple, everything seems to be working fine the condition maxPacketSize > length is what matters here.
Thanks for any help.
Hi,
Regarding your question "I have a problem with usb messages whose length is a multiple of 64, which is the maximum size of a usb fs packet for bulk out message", I suppose that this is a bug.
When the device transfers packet, each packet is 64 bytes, the last packet is less than 64 bytes,the packet with less than 64 bytes is treated as last bytes, the host will response with ACK handshake packet. But when the data size is exact multiple of 64 bytes, the device should add one packet with zero length data.
Hope it can help you
BR
XiangJun Rong