2026-03-24 9:05 AM
Hi,
The project was created in stm32mx from the example project cortexm_sysk.
It was generated as a CMake project and developed using VS Code.
The "USB Device Middleware Library MCU Software Component" library, version "V2.11.4 / 11-April-2025", was manually added.
CDC alone OK
UVC alone OK
CDC/HID OK
CDC/UVC NOT OK
See file in attachment.
I noticed the file descriptor is large (239 bytes). Is that a problem?
Is there another setting I need to change?
Regards,
Sébastien
2026-03-30 4:42 AM
Based on your description, the behavior strongly points to an issue in the CDC + UVC configuration / class descriptors. To avoid guessing, the most helpful next step is a full descriptor dump of the failing CDC UVC configuration. If possible, provide USB trace using usb protocol analyzer.
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-04-01 3:12 AM
Hi @FBL
Found in attachment wireshark capture of three configuration cdc only, uvc only, cdc+uvc.
I zip the prohect too, change define at the top of file usbd_conf.h to change configuration.
I see now enumerate cdc-uvc seem's right but only cdc is view by windows and functionnal, not the uvc.
regards,
Sébastien
2026-04-02 6:57 AM
Thanks for sharing the traces and project.
From the USBPcap/Wireshark capture, the CDC+UVC configuration descriptor that Windows receives is structurally almost correct, but there is a descriptor inconsistency in the Video interface collection that explains why only CDC is exposed.
In your composite configuration: the UVC IAD correctly groups:
However, two fields still use interface numbers from the standalone UVC configuration (VC = 0, VS = 1):
VideoControl header baInterfaceNr
This value 1 is correct in a standalone UVC device (VS at interface 1), but in the composite build the VS interface is actually interface 3. So the VC header should point to interface 3, not 1.
VideoStreaming alternate setting 1
The descriptors show:
For UVC, all alternate settings of the VideoStreaming interface must use the same interface number. In your composite, VS alt 1 should also be interface 3, not 1 (which is used by the CDC-Data interface).
Because of these mismatches (VC header pointing to 1, VS alt 1 declared as interface 1 while the IAD says the UVC function is on interfaces 2–3), the Windows UVC driver rejects the Video interface collection and does not bind to it. CDC remains valid, so only CDC is visible and functional.
The fix should be in the composite builder function USBD_CMPSIT_VIDEODesc():
Use the dynamically assigned VS interface number in the VC header
Replace the hard coded 1 with the actual VS interface index assigned by the composite builder:
/* Class-specific VC Interface Header */
pSVCInDesc->bInCollection = 0x01U;
pSVCInDesc->baInterfaceNr = (uint8_t)pdev->tclasslist[pdev->classId].Ifs[1];
Here:
Use the same VS interface number for the alt 1 interface descriptor
Replace the hard coded interface number 1U:
/* USB Standard VS Interface Descriptor - data transfer mode */
/* Same interface as VS alt 0, Alternate Setting 1 */
__USBD_CMPSIT_SET_IF(pdev->tclasslist[pdev->classId].Ifs[1],
1U, /* AlternateSetting */
1U, /* bNumEndpoints */
UVC_CC_VIDEO,
SC_VIDEOSTREAMING,
PC_PROTOCOL_UNDEFINED,
0U);
This ensures that VS alt 0 and VS alt 1 both use the same interface number 3.
After these two changes, the UVC IAD (interfaces 2–3), VC header, and VS descriptors all should be consistent.
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-04-10 12:52 AM
2026-04-13 4:51 AM
bAlternateSetting is still zero in frame 10 and 13
I'm suspecting something missing in composite builder class. Let me check and get back to you.
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.