cancel
Showing results for 
Search instead for 
Did you mean: 

USB CDC device sometimes fails to receive

abaldur
Associate III

I'm using the USB CDC library on a STM32L452 created with CubeMX and have run into some problems with receiving data over USB. Every week or so I experience that the device stops receiving data (the transmit side works fine). In other words, the CDC_Receive_FS callback function is not triggered when I try to send data? Inside the CDC_Receive_FS there is a call to USBD_CDC_ReceivePacket which is preparing the OUT endpoint for reception. But since CDC_Receive_FS is not called, the OUT endpoint will never be ready to receive the next packet. When the problem occurs, I have tried to "manually" call the USBD_CDC_ReceivePacket which indeed makes the device start receiving data again.

So my questions are:

  • Why does this happen?
  • Are there any fixes?
  • Are there anything I can do to detect when it has happened so that I can call USBD_CDC_ReceivePacket to bring the receiving side back?

Best Regards,

/abaldur

0 REPLIES 0