STM32F769 USB Device High Speed
I am using FW_F7_V1.17.2 on STM32Cube to configure USB HS Device as a CDC. We are running with FreeRTOS and FatFS on a custom PCB. The external Phy is a USB3300. I am using MDK 5 IDE.
The STM32 is connected to a Windows 10 host, using a simple protocol to transfer data. When receiving, the host sends blocks of ~1kB of data and the STM32 responds using a short reply packet of 3-4 characters. This works well initially, with good data throughput for maybe 180 blocks or so. The system then stalls because the Windows side is not getting replies.
The reason for this is that CDC_Transmit_HS() returns USBD_BUSY continuously, because the flag TxState is non zero. Once in this state we are stuck. USB data can still be received, but we cannot transmit. There appears to be a bug in the ST USB Device stack, because this flag is not cleared by disconnecting USB, which I would have expected to reset the stack.
Now TxState is cleared in USBD_CDC_DataIn() and my debugging shows this is never called when the stall happens.
I am not familiar with the USB Device stack. I would appreciate any suggestions on how to debug this problem, or any thoughts about what may be happening.
