Skip to main content
Associate III
November 30, 2024
Solved

Issue Increasing USBD_VIDEO_EPIN_HS_MPS for UVC Implementation on STM32U5G9J-DK2

  • November 30, 2024
  • 1 reply
  • 951 views

Hello,

I am facing an issue while implementing USB UVC (Uncompressed) on the STM32U5G9J-DK2 board.

The setup works fine with USBD_VIDEO_EPIN_HS_MPS set to 1400U, and I can achieve image output. However, increasing the endpoint packet size beyond 1400U (e.g., up to 4000U) causes the device to stop being recognized in Device Manager.

The issue appears during the initialization process, where the ux_device_stack_class_register function in MX_USBX_Device_Init() returns UX_ERROR.

This results in the code getting stuck in the following loop:

status = MX_USBX_Device_Init(memory_ptr);
if (status != UX_SUCCESS)
{
     while(1)
     {
     }
}

For my application, I need to achieve a higher data rate, which requires increasing the endpoint packet size. If I can increase the value of USBD_VIDEO_EPIN_HS_MPS, it would allow me to send larger packets, which is essential for achieving my data rate goal.

I’ve attached a ZIP file containing my code for reference, along with a screenshot of the current image output in VLC Media Player.

Could you provide guidance on how to configure the endpoint packet size to meet my requirements or suggest alternative approaches to increase the data rate?

Thank you for your support!

Best answer by FBL

Hi @saikumar 

Thank you for your query. Due to limited bandwidth, I recommend starting with this article How to select suitable endpoints for your STM32 US... - STMicroelectronics Community to configure EP max packet size.
USBD_VIDEO_EPIN_HS_MPS is 1024U

1 reply

FBLBest answer
ST Technical Moderator
January 29, 2025

Hi @saikumar 

Thank you for your query. Due to limited bandwidth, I recommend starting with this article How to select suitable endpoints for your STM32 US... - STMicroelectronics Community to configure EP max packet size.
USBD_VIDEO_EPIN_HS_MPS is 1024U

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.Best regards,FBL