2026-04-16 4:32 AM - edited 2026-04-16 4:56 AM
Hello,
Using STM32F4 USB USB_OTG_HS, PCD_SPEED_FULL for USB Device CDC we are transmitting data to Host.
After some minutes the transmission gets stuck.
Although the TXFE IRQ is received, no XFRC IRQ happens and consequently TX state is not set back to 0. The DTXFSTS counter stays on 0x40 (empty is 0x80).
The USB trace looks normal. When the problem occurs the peripheral answers all IN Transactions with a NAK.
Why does the peripheral not transmit the data but does NAK instead?
The problem is seen with different types of Hosts (PC or other embedded devices).
Attached Log Output and Screenshot of the Trace.
HAL 2.4.2 us used. The TxState fix was applied (Enable/Disable IRQ moved to USBD_CDC_TransmitPacket)
Many thanks for any help.
2026-04-17 2:59 AM
Hi @h p
Based on your observation, the endpoint is returning NAK because the previous transfer does not complete correctly. This can happen if a new transmission is started before the preceding one has fully finished.
Could you please try transmitting smaller chunks, or inserting a short delay between transmissions, to see whether the behavior changes?
If possible, could you also provide a minimal firmware example that reproduces the issue based on CubeF4? This would help us analyze the behavior.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.