cancel
Showing results for 
Search instead for 
Did you mean: 

USB_FS CDC VCP

Sheraz2568
Associate II

Hello everyone,

I am trying to transfer data to LabVIEW using USB_FS (CDC, VCP). The reason, I shifted to USB_FS (12Mbits/sec) from UART was lower data transfer speed (115200 bps). However, I have one concern regarding USB_FS as CDC. I checked the VCP of the PC, it can be set to a maximum of up to 128000 bps (0.128Mbit/sec). Would it limit the overall data transfer speed of USB_FS or not?? if it would limit, then what is the purpose of using USB_FS CDC, because it would become the same transfer capability as UART? Moreover, if anyone can suggest an alternative high-speed data transfer approach. My data size is 22MB and should be transferred in not more than 10 Sec.  ( I am using STM32H743BIT6 MCU).

 

Sheraz2568_0-1698471521058.png

Sheraz2568_1-1698471550689.png

 

3 REPLIES 3
AScha.3
Chief II

no, on USB the real speed (if no real uart is source, but just the declaration of "serial" VCP) is the speed, USB in actual connection can give you.

USB (in full speed) is 12Mbit , but with packets/overhead can get real about 1MB/s transfer.

(this is same, even you set it to 9600 b ; here it is just an information, transfered to target, to set the speed there, if you connect a uart to send out the data and you can use it, to set the uart to this desired speed)

if you use usb hi-speed , maybe more is no problem (but this i never tried, STM had no hi-speed usb that time)

If you feel a post has answered your question, please click "Accept as Solution".

Thank you @AScha.3  for your reply,

I am sorry, I didn't catch your point. However, I am trying to know, if is it possible to transfer data to PC using USB_FS CDC configured as VCP or not at 12Mb/sec?? Because the speed that I got is far far less than 12Mb/sec, it lies in the range of UART speed. 

the usb bus has 12Mb , but with some (needed) gaps between data packets, you can only get close to this, maybe 8Mb -> 1MB/s (what i got in my tests , about 10y ago. ).

But this needs some "tweaking" : buffers and speed of loading the buffers needs to be optimized to get the best result, not only in your stm program, but also in the host (win or linux , i assume); i remember some setting of the buffers in windows , to get best speed.

see:

https://www.eevblog.com/forum/microcontrollers/stm32-vcp-throughput/

https://visualgdb.com/tutorials/profiler/realtime/usb/

https://willfrank.co.uk/stm32-vcp.html

https://stackoverflow.com/questions/44275560/what-is-the-maximum-speed-of-the-stm32-usb-cdc

https://community.st.com/t5/stm32-mcus-products/maximum-vcp-speed/m-p/437136

http://forum.chibios.org/viewtopic.php?t=625

 

If you feel a post has answered your question, please click "Accept as Solution".