Skip to main content
Johannes
Senior
May 11, 2023
Solved

Example for Azure RTOS USBX device video (UVC)

Hello everyone

Does anyone have example code for Azure RTOS USBX device class video (UVC)?

I was able to add Video to my USBX demo application on Nucleo H7A3

There was sample code for CDC_ACM and MSC (mass storage), this worked fine. But for device class video, I was not able to find any example code.

CubeIDE 1.12.1 generated two files

ux_device_video.c

ux_device_video.h

But both files only contain prototypes of callback functions which need to be filled

Like this:

/**
 * @brief USBD_VIDEO_StreamRequest
 * This function is invoked to manage the UVC class requests.
 * @param video_stream: Pointer to video class stream instance.
 * @param transfer: Pointer to the transfer request.
 * @retval status
 */
UINT USBD_VIDEO_StreamRequest(UX_DEVICE_CLASS_VIDEO_STREAM *video_stream,
 UX_SLAVE_TRANSFER *transfer)
{
 UINT status = UX_SUCCESS;
 
 /* USER CODE BEGIN USBD_VIDEO_StreamRequest */
 UX_PARAMETER_NOT_USED(video_stream);
 UX_PARAMETER_NOT_USED(transfer);
 /* USER CODE END USBD_VIDEO_StreamRequest */
 
 return status;
}

How to fill it, that it works?

Thanks

Johannes

This topic has been closed for replies.
mohamed.ayed
mohamed.ayedBest answer
ST Employee
May 31, 2023

Hi Johannes,

It's mentioned in readme file

https://github.com/STMicroelectronics/x-cube-azrtos-h7/blob/main/Projects/NUCLEO-H723ZG/Applications/USBX/Ux_Device_Video/README.md

if you you open ioc of application (download https://www.st.com/en/embedded-software/x-cube-azrtos-h7.html) change VIDEO_STREAMING_FORMAT to MJPEG and change video width and height finally generate code and include stream2.h in project instead of stream1.h

- stream2 FORMAT : UNCOMPRESSED and Width = 176, Height = 144 and the descriptor shall be updated.

23 replies

Johannes
JohannesAuthor
Senior
June 13, 2023

Hello Mohamed

Can you explain how the uncompressed video stream is composed? Are these individual images as well? Which format are they and how are they generated?

Johannes