cancel
Showing results for 
Search instead for 
Did you mean: 

transmitting array of random size over the VCP problem

manoritesameer
Associate II
Posted on April 14, 2014 at 22:10

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-vcp
1 REPLY 1
chen
Associate II
Posted on April 15, 2014 at 10:23

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 unfortunately 

 I 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.