From: Linge D. <li...@ri...> - 2012-06-12 19:14:03
|
Hi libopencm3 developers, I'm currently writing a usb cdc program on stm32f4 discovery board using libopencm3 and I'm experiencing problems with the OTG FS FIFO. In the program, there is a software buffer to store the incoming packets from USB. The problem is that if the software buffer is not read fast enough, it will get full and stop storing more data. I defined a user callback to call stm32f107_ep_read_packet to read the packets from OTG FS FIFO and the store the packets to the software buffer. If the callback is called and not all the data in the OTG FS FIFO are read and stored because the software buffer is full, the packets will be discarded by *for (i = 0; i < rxbcnt; i += 4)* *(void)*OTG_FS_FIFO(ep);* * * which will result in data loss. Is there any way to send a signal to the hardware to stop the OTG FS FIFO from taking in more data? Does anyone know a good solution to this problem? Thanks! -- Linge Dai |