STM32N6 USBX Composite Device: Integrating uvcl (UVC Library) vs. Native USBX for High-Bandwidth ISO with Dual CDC ACM
Hello ST Community,
I am working on an STM32N6 project where I need to implement a USB composite device containing three distinct classes:
-
CDC ACM Instance 1
-
CDC ACM Instance 2
-
UVC (USB Video Class)
Current Status & Setup:
The dual CDC ACM implementation is fully stable and working properly. I generated the basic framework using STM32CubeMX (.ioc), which handles the initial USBX configuration, the first CDC instance, and sets up the composite device configuration. Following that, I manually added the second CDC ACM instance code to the project.
On top of this working multi-CDC setup, I now want to integrate the Video Class layer. I have enabled the core video class inside the .ioc file and regenerated the code to expand the descriptor framework.
The Challenge:
To support high-bandwidth Isochronous (ISO) streaming for the Video class component, I integrated the uvcl (USB Video Class Library) middleware extracted from the ST Edge AI Getting Started example
The issue started exactly upon adding the uvcl library. I noticed that its initialization function completely wraps the global USB device controller registration (ux_device_stack_initialize) and grabs the only available configuration descriptor for itself. By letting uvcl take over stack initialization this way, it breaks/overwrites my composite device descriptor layout, and my two working CDC instances stop functioning entirely.
My Target Stream Configurations:
The UVC interface needs to support high-bandwidth ISO transfers for YUV422 at 30 FPS across these specific resolutions:
-
224 X 224 @ 30 FPS
-
256 X 256 @ 30 FPS
-
480 X 480 @ 30 FPS
-
640 X 480 @ 30 FPS
-
800 X 480 @ 30 FPS
My Questions:
-
Is high-bandwidth ISO transfer possible using native USBX functions alone, without integrating the
uvcllibrary? Can standard USBX handle multiple transactions per microframe (e.g.,wMaxPacketSizeset to0x0C00or0x1400for 2x or 3x 1024 bytes) natively via the standardux_device_class_video_transmitengine? -
If
uvclis absolutely mandatory for achieving high-bandwidth ISO on the STM32N6, how can I integrate the library without letting it take over the global USBX initialization? Is there a recommended way to decoupleuvclfrom the core stack setup so that it only acts as a payload/streaming engine for the specific UVC class instance inside a pre-existing composite device configuration.
Any advice, patches, or architectural guidance on how to stream these YUV422 resolutions over a composite stack without breaking existing CDC paths would be highly appreciated!
