2026-03-27 6:15 AM - last edited on 2026-03-27 6:58 AM by FBL
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?
2026-03-27 6:58 AM
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.
2026-03-27 8:19 AM
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?
2026-03-30 4:25 AM
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.
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.