STM32U5 USB (CDC) not transmitting data if in exact multiple of 64 bytes
I'm debugging an issue where my application is using device mode USB with CDC-ACM and when I come to transmit a data packet on a bulk IN endpoint that is either 64 or 128 bytes in length, the data is not received by the host until either a different length data packet is tx'd or a certain number of 64 byte tx is done.
System details:
- STM32U585
- MCU package 1.2.0
- Azure RTOS and USBX (6.2.0) as per MCU package.
- Win 10 host pc
As far as I can tell, everything is going through the HAL/LL layers correctly:
The end point config (DIEPCTL2) has a MPSIZ=0x40 (64 bytes).
When it comes to transmit the data, DIEPTSIZ2 gets set with XFERSIZ=0x40, PKTCNT=1, MCNT=0 and the endpoint is enabled (within USB_EPStartXfer in the HAL).
The ITTXFE interrupt is enabled so the function `PCD_WriteEmptyTxFifo` gets called as expected and `USB_WritePacket()` is called to shift the 64 bytes in to the FIFO.
However, running wireshark on the PC side shows no IN data at all. If I transmit 63 bytes from the device then all is good. If I tx 64 bytes then some other non 64-byte multiple then the PC IN endpoint will get the missing data.
I can't quite see how this is failing so any advise will be good!
