cancel
Showing results for 
Search instead for 
Did you mean: 

Maximum speed of the USB CDC using the HAL library

mh2
Associate III
Posted on May 31, 2017 at 08:52

Hi everybody,

I have used STM32 HAL libraries to communicate with PC using USB CDC. I want to send a huge amount of data to PC and so, the communication speed is very important to me. However I could get very low speed from the usb cdc.

I want to the maximum speed of the usb cdc using the HAL library? and which class of the usb devices is the best for my purpose?

I appreciate any attention

5 REPLIES 5
mh2
Associate III
Posted on June 05, 2017 at 17:15

Nobody can help me?

Posted on June 05, 2017 at 17:28

>>

and which class of the usb devices is the best for my purpose?

MSC would tend to be the most efficient, reading large contiguous blocks of storage. Remember USB is half-duplex.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on June 05, 2017 at 18:07

Thanks for your attention

I should use cdc class for some reason, however i do not know the maximum speed of the cdc in usb fs. How i can reach 1Mbyte/second speed?

Posted on June 05, 2017 at 21:35

I suspect that's on the optimistic side, you might get 80% of that. There have been some discussions about the CDC implementation here before, don't recall the outcome, not something I can provide support on.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on June 06, 2017 at 01:56

Thanks Clive One. Speed of 80% of 1Mbyte/s is also good. However i reached a low speeds using Hal libraries. I use Device monitoring studio to log the received data from the stm32 and the speed is very low. 

I used simple code to test the Cdc speed. In the main loop, i used cdc_fs_transmit to send data and the buffer size passed to this function  is 4096kbyte. This is my code. However the speed is very low. Can anybody guide me about this?

thanks