Skip to main content
whitehorsesoft
Associate III
Jan 30, 2026 1:17 PM UTC
Solved

USB CDC and USART recommended practice

When using USB CDC to communicate via USART, and interacting with USART data, in code is it recommended to interact with it at the USB side, or to interact with it at the USART side?

From what I can tell, both offer both polling and interrupt methods. The USART offers DMA access, but apart from that it's not clear what, if any, tradeoffs there are between USB CDC and USART.

FBLBest answer
ST Technical Moderator
Jan 30, 2026 3:26 PM UTC

Hi @whitehorsesoft 

For applications requiring higher data rates and USB connectivity, USB CDC is more convenient because USB CDC provides dedicated functions for managing data transfer efficiently: CDC_Receive CDC_Transmit to handle received/transmitted packets from the USB host using interrupt callbacks.

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.Best regards,FBL

3 replies

FBLBest answer
ST Technical Moderator
Jan 30, 2026 3:26 PM UTC

Hi @whitehorsesoft 

For applications requiring higher data rates and USB connectivity, USB CDC is more convenient because USB CDC provides dedicated functions for managing data transfer efficiently: CDC_Receive CDC_Transmit to handle received/transmitted packets from the USB host using interrupt callbacks.

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.Best regards,FBL
TDK
Jan 30, 2026 4:01 PM UTC

If the signal has to travel over UART, I would use UART. It is a much simpler interface with less things to go wrong. If the signal can be passed entirely over USB, and you need the speed, use usb.

Benefits to each:

  • UART: simplicity
  • USB: speed
"If you feel a post has answered your question, please click ""Accept as Solution""."
whitehorsesoft
Associate III
Jan 31, 2026 2:36 AM UTC

After learning a little more, I realized my question doesn't make much sense. I'm not actually "using USB CDC to communicate via USART" although I thought I was. Is there a way to request this question be removed? I'd do it myself but don't see a way.