2025-07-09 3:16 AM
Hello ST Community,
I'm working with the STM32N6570-DK board and using the ST-provided UVC video streaming example.
By default, the example uses MJPEG format, but I modified the UVC descriptors to stream in UNCOMPRESSED format (YUY2).
Where as i am sending static image data
-->> When using a lower resolution configuration 320*236 and HS_MPS is 512 , Then the static image displays correctly on Windows Camera, and Wireshark shows proper isochronous packets.
However, when I change the configuration to a higher resolution like 800×480 and increase HS_MPS:
#define USBD_VIDEO_EPIN_HS_MPS 1024 // Also tried 2044, 3036, 3072
#define UVC_FRAME_WIDTH 800U
#define UVC_FRAME_HEIGHT 480U
#define USBX_DEVICE_MEMORY_STACK_SIZE (32*1024)
#define UX_DEVICE_APP_THREAD_STACK_SIZE 2048
#define TX_APP_MEM_POOL_SIZE (16*1024)
#define UX_DEVICE_APP_MEM_POOL_SIZE (48*1024)
#define USBPD_DEVICE_APP_MEM_POOL_SIZE (5*1024)
.LD file in STM32CubeIDE :
.usbx_data 0x341D8000 (NOLOAD) : { *(.UsbHpcdSection) } >RAM
.usbx_bss 0x341E0000 (NOLOAD) :{ *(.UsbxPoolSection) } >RAM
-->> The enumeration completes, the UVC device appears in Device Manager, and Windows Camera detects it, but no image is displayed. In Wireshark, I observe only 1575-byte isochronous packets (despite setting HS_MPS to higher values), and no data is visible.
-->>Moreover, when I increase HS_MPS above 1024, the device fails to enumerate or get recognized by the host.
For comparison, I tested the ST-provided binary from the following link:
https://github.com/STMicroelectronics/x-cube-n6-camera-capture/tree/main/Binary
This works fine with the default IMX335 camera, streams live data via UVC, and Wireshark shows HS_MPS = 3072, with high frame rates and smooth display on Windows Camera.
Questions:
What is the proper way to increase USBD_VIDEO_EPIN_HS_MPS upto 3072 safely?
Are there any special pool sizes or USB stack configurations required for high MPS and large resolution support?
Could ST kindly share the source code for the example binary provided in the GitHub repo above? It would help to resolve this issue and understand the correct setup for high-resolution UVC.
Thanks in advance for your support.
2025-07-15 8:06 AM
Hi @saib
First, according to the USB 2.0 specification, the maximum packet size for high-speed isochronous endpoints is 1024 bytes per microframe (125 µs). So, to achieve higher bandwidth, increase the number of packets per frame rather than increasing packet size.
Ensure the video frame buffer size matches the resolution and format:
Frame Size=Width×Height×Bytes per pixel.
Adjust the UVC payload header size and ensure proper framing of video data across multiple USB packets.
You can find here the source code for the binaries.
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.