CCID USBD transfer block (splitting)
Hello,
I'm currently preparing the firmware for a USB NFC reader (CCID). I'm working with the STM32F103 MCU and the ST25R3916 NFC reader.
The STM32F103 MCU is programmed on a CCID USB device using the CCID USBD driver provided by STM32. The MCU acts as the mediator between the computer and the ST25R3916 NFC reader. It takes the APDU command sent by the computer and transfers it to the NFC reader, and takes the NFC reader's response and transfers it to the computer using the SC_Itf_XferBlock() function.
The STM32F103 MCU supports usb full-speed, this means that the maximum amount of data to be transferred to the computer is 64 bytes. If you want to transfer data larger than 64 bytes, you transfer it using chunk-by-chunk methods.
To transfer 253-byte data, the splitting is as follows:
5 chunks: chunk 1 (54 bytes of data with 10 bytes of header), chunk 2 (64 bytes of data), chunk 3 (64 bytes of data), chunk 4 (64 bytes of data), and chunk 5 (7 bytes).
The issue is that when I try to transfer 253 bytes of data using splitting, the computer finishes the transfer directly after chunk 4 and doesn't wait for chunk 5, knowing that chunk 4 is 64 bytes long, and I don't send any 0s after chunk 4.
This problem is related to my firmware (CCID USB driver). Can you help me resolve this issue?
Thanks in advance.
