STM32N6 USB - UVC Shows Black Screen, PayloadDone Callbacks Not Triggered
Hi,
I'm developing a composite USB device on STM32N6 with:
- 2x CDC ACM interfaces (Dual Virtual COM Port)
- 1x UVC (USB Video Class) interface for camera streaming
The CDC ports work correctly. The UVC class enumerates successfully and the camera application opens without errors. However, the video stream shows a black screen - no actual frame data
is being transmitted.
What Works
1. USB Composite device enumeration succeeds
2. Both CDC ACM ports work (LOG port sends heartbeat, DATA port echoes)
3. UVC class registers correctly with USBX
4. Host can open camera application (VLC, Cheese, etc.)
5. UVC GET_DEF(PROBE) requests are handled correctly
6. SET_CUR(PROBE/COMMIT) requests are handled correctly
7. StreamChange callback fires when host starts streaming (alt=1)
8. Packets are queued via ux_device_class_video_write_payload_get() (returns success)
9. ux_device_class_video_transmission_start() returns UX_SUCCESS
What Doesn't Work
→ PayloadDone callback is never triggered
→ No video data reaches the host (black screen)
→ Host immediately stops streaming (alt=0 after ~1 second)
Debug Output
[UVC] Early_Init: ret=0 streams=5
[UVC] Activate: inst=0x3413a7f8
[UVC] UpdateCallbacks: updating from App
[UVC] StreamReq: type=0x21 req=0x01 wVal=0x0100
[UVC] SET_CUR(PROBE)
[UVC] StreamReq: type=0xa1 req=0x81 wVal=0x0100
[UVC] GET_CUR(PROBE) -> OK len=26
[UVC] StreamReq: type=0x21 req=0x01 wVal=0x0200
[UVC] SET_CUR(COMMIT)
[UVC] StreamChange: alt=1 (STREAMING START)
[UVC] DataIn[1]: state=1 pkt_sz=512
[UVC] DataIn: no frame, sending 2-byte header
[UVC] SendPkt enter: pkt_len=2 stream=0x3413a958
[UVC] SendPkt: buf=0x3413a9a4 buflen=1024
[UVC] SendPkt OK: cnt=1 len=2 ret=0
[UVC] SendPkt OK: cnt=2 len=2 ret=0
[UVC] SendPkt OK: cnt=3 len=2 ret=0
[UVC] SendPkt OK: cnt=4 len=2 ret=0
[UVC] StreamChange: tx_start ret=0
[UVC] ShowFrame: OK sz=100352
HEARTBEAT...
HEARTBEAT...
[UVC] StreamChange: alt=0 (STREAMING STOP)Questions
1. In UX_STANDALONE mode, how should isochronous endpoint completion be handled for video class? Should ux_system_tasks_run() be called from interrupt context?
2. Is there a known issue with USBX Video Class in composite devices with CDC?
3. Are there any reference projects showing USBX composite device with both CDC and Video Class working together?
4. Could the issue be related to FIFO configuration or endpoint allocation when both CDC and Video classes share the same USB controller?
