Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the maximum speed of the STM32 USB CDC?

Tags:

usb

cdc

stm32

I'm using an STM32L151 to communicate with a PC using USB CDC. I used the STM32 HAL libraries to create my project. I found that the USB sends data in 1 ms intervals, and each time 64 bytes are being sent. So, is the maximum speed of the USB CDC 64 kbyte/s? That is much lower than the USB Full Speed data rate of 12 Mbit/s. How can I reach this speed, or at least a fraction of this speed?

like image 513
Mohammad Avatar asked May 31 '17 04:05

Mohammad


People also ask

Does STM32 support USB?

Some STM32 MCUs include two USB peripherals and support both OTG in FS and HS speeds.

What is USB CDC host?

USB communications device class (or USB CDC class) is a composite Universal Serial Bus device class. The communications device class is used for computer networking devices akin to a network card, providing an interface for transmitting Ethernet or ATM frames onto some physical media.

How does USB CDC work?

A subset of the USB Communication Device Class (CDC) can be used to emulate a serial port providing a virtual COM port UART interface. This allows developers to use legacy applications with new products using the same COM port interface as before, with few hardware and software modifications.


1 Answers

Nope. If your code is "fast enough", the maximum CDC speed is about 1MByte/sec. This may require a big (>1KB) FIFO on the device side. Oh, and the PC side must be able to read the data fast enough, e.g. with big buffers.

The 64KByte/s limit applies for USB HID which uses interrupt endpoints. USB CDC interface uses faster bulk endpoints.

like image 64
Turbo J Avatar answered Oct 09 '22 21:10

Turbo J