2014-04-14 01:10 PM
hello,
I want to transmit data over USB VCP of variable buffer size from 10 to 10000 in size, but I am losing data erratically especially when buffer is of larger dimension. Can anyone please tell me the best way of transmitting these large size blocks of data without loss of information.Thanks #stm32-usb-vcp2014-04-15 01:23 AM
Hi
I assume (since you are using an F4 part) that you are using the USB OTG library. '' I am trying to send 10000 size array over the VCP but unfortunatelyI seem to be losing data erratically. I dont know what parameters to set in usbd_conf.h
'' I do not think your problem is to do with the configuration. Your problem is more likely to be to do with the way the VCP code deals with the buffer for transmitting data to the PC. Search for ''APP_Rx_Buffer'' ''APP_Rx_ptr_in'' and ''APP_Rx_length'' To send data to the PC - the data is put into APP_Rx_Buffer and the 'pointer' ''APP_Rx_ptr_in'' is updated. However, if you look at the code that access and transmits the data - there is no proper buffer overflow detect and no proper way to detect when data is ready to send.