Exchange resolution control messages between the Host and FX3 configured as UVC-class device - AN75779

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
bojankoce
Level 3
Level 3
25 replies posted 10 replies posted 5 replies posted

Hello, guys.

In our system we have FX3 controller used to control various IMX image sensors through FPGA. In FX3 we have implemented the firmware from AN75779 (as a starting point) which makes our system recognized as UVC-class device from the Host PC.

There is a need to dynamically change the resolution of the video streams during runtime of the system. In this thread, you explained how we can change the resolution of the stream when the request is initiated by the Host PC.

1) Now, there is one more use case when the request for the resolution change will come from the FX3 device. This is the request to change the resolution from the default one to the desired one.

Namely, our system is designed to support different image sensors from IMX family. Consequently, we would like to be able to start streaming different resolutions depending on the IMX sensor connected (e.g. IMX250, IMX253, IMX420...). We are able to get the IMX sensor ID within CyFxUVCApplnInit() function. However, I am not sure how to inform the Host which resolution will be played. Host expects DEFAULT resolution to be played which is always THE LAST Class specific Uncompressed VS frame descriptor described in CyFxUSBSSConfigDscr[] descriptor!

Untitled.png

I tried with sending

CyU3PUsbSendEP0Data (CY_FX_UVC_MAX_PROBE_SETTING, (uint8_t *)glProbeCtrl_1934x1094_30fps);

to the Host as soon as I get IMX sensor ID but to no avail! It seems something more is needed.

What I am missing here? How FX3 can tell the Host during start-up process which resolution will be played?

2) We need to have a closer communication between the Host and FX3. In addition to requesting basic parameters like change resolution, get gain etc. we would like to be able to send some more requests from the Host to FX3 like:

- Start playing patterns

- Read the value of image sensor register and send it to me (e.g. register value that stores temperature).

To the best of my understanding, extension unit can be used to implement custom (vendor-specific) features (I am aware we need to customize Host application for that).

On page 11 (Section 2.3.2.1) of AN75779 document, you give some explanations on how to design UVC extension unit in FX3 firmware (this thread). I would like to try my luck and implement that. At the same place you mention uvc_extension_app_x64.exe file as well as

"Guidelines to run the Host application is provided in the readme.txt file in the attached project"

Where I can find that uvc_extension_app_x64.exe file and attached project you are talking about?

Thanks for your time and efforts.

Sincerely,

Bojan.

0 Likes
1 Solution

Hello Bojan,

From the explanation this is what i understood

- The sensor cannot be changed dynamically.

- Only one sensor will be connected at a time so one ID will be fetched.

- Based on this ID the default video stream need to be decided.

The default video settings for a sensor is set when the host requests Probe_Ctrl (get_cur)

  switch (wValue)

    {

        case CY_FX_UVC_PROBE_CTRL:

            switch (bRequest)

            {

                case CY_FX_USB_UVC_GET_INFO_REQ:

                    glEp0Buffer[0] = 3;                /* GET/SET requests are supported. */

                    CyU3PUsbSendEP0Data (1, (uint8_t *)glEp0Buffer);

                    break;

                case CY_FX_USB_UVC_GET_LEN_REQ:

                    glEp0Buffer[0] = CY_FX_UVC_MAX_PROBE_SETTING;

                    CyU3PUsbSendEP0Data (1, (uint8_t *)glEp0Buffer);

                    break;

                /* There is only one setting per USB speed. */

                    if (usbSpeed == CY_U3P_SUPER_SPEED)

                      if (sensor id == 1)

                    {

                        CyU3PUsbSendEP0Data (CY_FX_UVC_MAX_PROBE_SETTING, (uint8_t *)glProbeCtrl_{resolution_of_appropriate_frame_index});

                    }

                    else if (sensor_id == 2)

                    {

                        CyU3PUsbSendEP0Data (CY_FX_UVC_MAX_PROBE_SETTING, (uint8_t *)glProbeCtrl_{resolution_of_appropriate_frame_index});

                    }

                    break;

This request comes after device is enumerated. So if you want the default video settings based on sensor id, you have to get the sensor id from FPGA/sensor before enumeration starts.

Regards,

Rashi

Regards,
Rashi

View solution in original post

0 Likes
13 Replies