2025-01-28 2:43 AM
Hello,
I am working with the STM32U5G9ZJT6Q MCU to implement a USB UVC application. Here are the key details of my setup:
The issue I am facing is that for each isochronous packet, only 30 micro packets contain valid data, while the remaining 98 micro packets (out of 128 total) are empty. This limits the overall data throughput.
I would like to understand how I can increase the number of micro packets with valid data in each isochronous packet to optimize data transfer performance.
Steps I have tried:
Could this be related to:
I am sharing zip file of the code for the reference.
Thank you in advance!
2025-07-17 3:20 AM
Hi @saikumar
Would you share USB traffic? to check whether it's timing issue or bandwidth limitation.
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.
2025-07-17 10:16 PM - edited 2025-07-17 10:20 PM
Hello , mr @FBL
iam also facing same problem above explained.
1. As requested, I’m sharing the USB UVC packet trace captured using Wireshark .
2. Below is a brief explanation of how I'm preparing and sending UVC packets:
Resolution: 640x480
Format: YUV2 (16 bits per pixel)
Frame size : UVC_MAX_FRAME_SIZE (UVC_FRAME_WIDTH * UVC_FRAME_HEIGHT * 16U / 8U)
Max packet size : USBD_VIDEO_EPIN_HS_MPS 2044U
Payload header: 2 bytes (0x02 ,0x00)
Once all packets for a frame are sent, I reset packet_index and wait for the next frame (indicated by usb_tx_complete = 1 ( which is poll from DCMI frame interrupt ) ).
Logic :
2025-07-18 9:28 AM
Hi @saikumar
I tried to replicate your issue using your code, with reference board, U5G9 disco kit. The device cannot enumerate at all.
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.
2025-07-18 10:57 AM
Hello, mr @FBL
Thank you for your reply and for trying to reproduce the issue.
By default, the U5G9 Discovery Kit provides a 16 MHz clock to the USB HS PHY. However, in my setup, I'm using external oscillator to provide 32MHz clock to the USB PHY.
Due to this hardware difference, I had to modify one parameter in the usb_otg.c file, specifically in HAL_PCD_MspInit() function,
SYSCFG_OTG_HS_PHY_CLK_SELECT_1 (for 16Mhz) to SYSCFG_OTG_HS_PHY_CLK_SELECT_6 (for 32Mhz)
so please set it for 16Mhz as shown bellow
HAL_SYSCFG_SetOTGPHYReferenceClockSelection(SYSCFG_OTG_HS_PHY_CLK_SELECT_1);
Thanks,