2022-11-24 4:11 AM
In the callback I buffer the input read by the USBD_CDC_ReceivePacket() call and exit My_CDC_Receive_FS() asap, processing the incoming data in the background
Sometimes, my input buffer fills, & I can't easily make it any larger or empty it any quicker
How can I hold-off the incoming data without upsetting the USB driving code?
(i.e. simply not calling the USBD_CDC_ReceivePacket() fn if my buffer is full is not an option as it seems to close the USB connection / upset the USB driver)?
2022-11-24 8:57 AM
That's exactly how you are supposed to do it. By not calling CDC_ReceivePacket() you may safely delay the incoming data. If there is a problem with your application, it's probably somewhere else.
Be warned, however, that all USB-related routines, like Transmit and ReceivePacket, must be called from an interrupt service routine of the same priority as USB interrupt or, alternatively, with interrupts being disabled.
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.