AnsweredAssumed Answered

STM32 Flush USB Buffer

Question asked by Wer.Mark on Oct 12, 2016
Latest reply on Oct 17, 2016 by FTITI.Walid
Hello all,

I'm using the ST Library for USB Communication via VCP and as CDC Device.Now I'm trying to flush the buffer, when the µC recieves a "p" from the PC. I already tried to set APP_Rx_ptr_in and APP_Rx_ptr_out to 0, but this has no effect.  How can I flush the buffer properly?

Thanks for any advice!

Mark

Edit: I tried something different, should this do the job?

USB_OTG_CORE_HANDLE  USB_OTG_dev;
 
void FlushFifo(void)
{
    USB_OTG_FlushTxFifo(&USB_OTG_dev, 0x10); /* all Tx FIFOs */
    USB_OTG_FlushRxFifo(&USB_OTG_dev);
}

Outcomes