Question
A potential bug in USB VCP example in STM32_USB-Host-Device_Lib_V2.1.0
Posted on February 05, 2014 at 11:37
Hi all,
I a using an STM32F407 device with ST standard library and USB lib.In Handle_USBAsynchXfer() function in usbd_cdc_core.c file:There is a potential bug when roll-back occurs.Two pointers are used:APP_Rx_ptr_in: is incremented when data received over UARTAPP_Rx_ptr_out: is incremented when received data over UART are sent over USBLet's have an example:if APP_Rx_ptr_in = 3 and APP_Rx_ptr_out = 2047==> this means that I have received 4 data over UART (I have to send them over USB)But as states the code below if APP_Rx_ptr_out > APP_Rx_ptr_in, the size isAPP_RX_DATA_SIZE - APP_Rx_ptr_out => 2048 - 2047 = 1 !!I think it should be (APP_RX_DATA_SIZE - APP_Rx_ptr_out) + APP_Rx_ptr_inWhat do you think? #usb-cdc-vcp