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

cross mob

FX3/CX3: UVC Extension Unit Application

lock attach
Attachments are accessible only for community members.

FX3/CX3: UVC Extension Unit Application

ChaitanyaV_61
Employee
Employee
50 questions asked 25 likes received 25 sign-ins

Find answers on frequent UVC Extension Unit Application questions.

1. Is it possible to add vendor-specific features to UVC firmware?

Yes, it is possible to add vendor-specific features to UVC firmware. As per the USB Video Class specification, the Extension Unit allows vendor-specific features to be added, much like standard USB Vendor Requests. AN75779 - How to Implement an Image Sensor Interface with EZ-USB FX3 in a USB Video Class (UVC) Fram... implements a UVC Extension Unit. A sample Extension Unit control, Get or set device firmware version is implemented in the AN75779 firmware.

For details on implementing Extension Unit Control, see Implementing Extension Unit Control in AN75779 Example Project - KBA219280.


2. How do you communicate with the UVC Extension Unit?

In the AN75779 firmware, the Extension Unit is empty, but a sample design is implemented, and it can be enabled to get or set the device firmware version. The device can support more than one extension unit.

If the Extension Unit is used, the standard host application will not recognize its features unless the host application is designed to recognize them. Custom extension controls and the host application can be designed to query these controls.

A sample host application (Console App) to get or set the device firmware version from the AN75779 firmware is provided with this knowledge base article (KBA). This sample host application is built with Visual studio 2015 (VS 2015). It uses the SetGetExtensionUnit API to send the SET/GET requests to the Extension Unit of the UVC device.


3. An error 0x80070492 occurs while using the UVC Extension Unit sample host application. What could be the reason?

While using the UVC Extension Unit sample application to communicate with Extension Unit of UVC firmware, it is possible to get an error as shown in Figure 1.

Figure 1. Error 0x80070492

   pastedImage_6.png

Error 0x80070492 is E_PROP_SET_UNSUPPORTED, which occurs when the specified property set is not supported. The property set in this sample host application corresponds to the GUID used. This error occurs if there is a mismatch between the GUID of the Extension Unit and the GUID of host application.

To resolve this error:

  • Update the 16-byte GUID field of the Extension Unit Descriptor in the cyfxuvcdscr.c file with the GUID generated using Visual Studio.
  • If using the default AN75779 firmware, check if the UVC_EXTENSION_UNIT macro is enabled.


4. An error 0x80070490 occurs while using UVC Extension Unit sample host application. What could be the reason?

While using the UVC Extension Unit sample application with the extension unit in UVC firmware, it is possible to get an error as shown in Figure 2.

Figure 2. Error 0x80070490

  pastedImage_7.png

Error 0x80070490 is E_PROP_ID_UNSUPPORTED, which occurs when the specified property identifier is not supported. The property identifier in this sample host application corresponds to bmControl (vendor-specific control) supported by the device, mentioned in the Extension Unit descriptors.

This error occurs when the SET/GET requests are not handled correctly in the firmware or when the control to which the host application addresses the request is not supported by the UVC device.

To resolve this error:

  • Check that the vendor-specific control supported by the host application and by the UVC device is same. You can check the bmControl field of the Extension Unit descriptors as shown in Figure 4.
  • Make sure that in the firmware, the SET/GET requests from the host application are handled correctly based on Implementing Extension Unit Control in AN75779 Example Project .

For example, in the sample host application, 0x01 vendor-specific control is supported. So, the SET/GET requests will be sent addressed to the 0x01 control from the host. The UVC device should be able to support 0x01 control and handle the SET/GET requests from the host and respond to the requests correctly.

     The descriptors of AN75779 example firmware, shown in Figure 3, support 0x01 control.

Figure 3. Extension Unit - bmControl Field

  pastedImage_8.png

 

Figure 4. Handling SET/GET Request Addressed to Control Supported by the Device

   pastedImage_9.png

 

Figure 5. Control Definition

   pastedImage_10.png

Note: Customer-specific bmControls can be added and enabled in the descriptors as shown in Figure 3. The host application needs to be modified to support the controls.

  • Check that the expected data is sent through the control interface in response to the SET/GET request from the host application.
  • Make sure that the data length requested by the host matches the length supported by the UVC device.


5. Is there a CX3 example code with Extension Unit Enabled?

CX3 example code can be modified to support Extension Unit and handle vendor-specific request. The example code, CX3: OV5640, attached with this KBA adds vendor specific-features to the UVC device on enabling the UVC_EEXTENSION_UNIT macro. This firmware is tested with the sample host application attached with this KBA.

Note: On programming the CX3 device with the firmware attached with the KBA, CX3 will enumerate as FX3 device as VID/PID, and the standard product string descriptor are changed in the firmware to make the firmware compatible with the Extension Unit host application.

 

 

Author: HemanthR_06           Version: **

Translation - Japanese: FX3 / CX3:UVC拡張ユニットアプリケーション – KBA230466 - Community Translated (JA)

Attachments
0 Likes
3364 Views