2023-10-27 10:46 PM - edited 2023-10-27 10:48 PM
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).
2023-10-28 12:13 AM - edited 2023-10-28 12:17 AM
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)
2023-10-29 03:46 AM - edited 2023-10-29 03:48 AM
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.
2023-10-29 04:16 AM - edited 2023-10-29 04:27 AM
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