Skip to main content
Associate II
March 27, 2026
Question

STM32N6 two USB device classes running simultaneously

  • March 27, 2026
  • 3 replies
  • 151 views

Hello,

I have custom STM32N657 board with two USB ports. There is USBX device video class running on USB Port 1 and streaming video - all good here, working well.
I would like to get exactly the same functionality on USB port 2 - second USB video device. The STMCubeMX supports only one USB port in device mode - that is also limitation of USBX
"Only one USB device controller can be defined at any time to operate in device mode."
azure-rtos_rtos-docs/rtos-docs/usbx/usbx-device-stack-2.md at main · azemb-todd/azure-rtos_rtos-docs · GitHub

What is the best approach to get second USB port running in USB video class in device mode?

3 replies

Technical Moderator
March 27, 2026

Hi @PeterPan 

For multi interfaces device, we recommend to build a composite device. Otherwise, you can only have one USB controller in device mode at a time. USBX’s device stack is designed around a single device controller instance.

I hope this helps!

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.Best regards,FBL
PeterPanAuthor
Associate II
March 27, 2026

Hi @FBL 

Thank you for quick reply. There are two image sensors connected to the board so I need two video streams. Also, essential is double the bandwidth. What are other possible solutions?

Technical Moderator
March 30, 2026

Hi @PeterPan 

If both video streams can be compressed or down scaled enough to fit within a single USB HS link, the recommended approach is to build a composite UVC device on one STM32N6 USB port.

In practice, this means you keep one USB device controller active in device mode.

You define one configuration descriptor that contains: Two UVC interface sets (one for each camera: VideoControl + VideoStreaming).

The host will typically see two separate webcams coming from a single USB device.

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