ez usb fx3

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

cross mob
wyw
Level 3
Level 3
25 replies posted 25 sign-ins 10 replies posted

I have done both of uac and uvc in fx3 development board that refer to USBAudioClass and USBVedioClass demo project of SDK,the usb3.0 connect to windows10,and my computer device manager dispaly follows:

wyw_0-1629789023047.png

the uvc was Identified  in camera,but uac Identify failed.

1 Solution
lock attach
Attachments are accessible only for community members.
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

Please test the attached firmware which enumerates as expected at my end

 

Regards,
Rashi

View solution in original post

0 Likes
8 Replies
wyw
Level 3
Level 3
25 replies posted 25 sign-ins 10 replies posted

the part of cyfxuvcdscr.c as follows:

#include "cyfxuvcinmem.h"const uint8_t CyFxUSB30DeviceDscr[] __attribute__ ((aligned (32))) =
{
0x12, 
CY_U3P_USB_DEVICE_DESCR, 
0x10,0x03, 

#ifndef USB_UAC_CLASS
0xEF, 
0x02, 
0x01,
#else
0x00, 
0x00, 
0x00, 
#endif

0x09, 
0xB4,0x04, 
0x22,0x47, 

#ifndef USB_UAC_CLASS
0x00,0x00, 
#else
0x01,0x00, 
#endif

0x01, 
0x02, 
0x00, 

#ifndef USB_UAC_CLASS
0x01 
#else
0x02 
#endif

};const uint8_t CyFxUSB20DeviceDscr[] __attribute__ ((aligned (32))) =
{
0x12, 
CY_U3P_USB_DEVICE_DESCR, 
0x10,0x02, 

#ifndef USB_UAC_CLASS
0xEF, 
0x02, 
0x01, /* Device protocol */
#else
0x00, 
0x00, 
0x00, 
#endif

0x40, 
0xB4,0x04, 
0x22,0x47, 

#ifndef USB_UAC_CLASS
0x00,0x00, 
#else
0x01,0x00, 
#endif

0x01, 
0x02, 
0x00, 

#ifndef USB_UAC_CLASS
0x01 /* Number of configurations */
#else
0x02 /* Number of configurations */
#endif

};

/* Binary device object store descriptor */
const uint8_t CyFxUSBBOSDscr[] __attribute__ ((aligned (32))) = /*add 20210823,the description is inconsistent with that of usB3.0 protocol*/
{
0x05, /* Descriptor size */
CY_U3P_BOS_DESCR, /* Device descriptor type */
0x16,0x00, /* Length of this descriptor and all sub descriptors */
0x02, /* Number of device capability descriptors */

/* USB 2.0 Extension */
0x07, /* Descriptor size */
CY_U3P_DEVICE_CAPB_DESCR, 
CY_U3P_USB2_EXTN_CAPB_TYPE, /* USB 2.0 extension capability type */
0x1E,0x64,0x00,0x00, /* Supported device level features: LPM support, BESL supported,
Baseline BESL=400 us, Deep BESL=1000 us. */

/* SuperSpeed Device Capability */
0x0A, /* Descriptor size */
CY_U3P_DEVICE_CAPB_DESCR, /* Device capability type descriptor */
CY_U3P_SS_USB_CAPB_TYPE, /* SuperSpeed device capability type */
0x00, /* Supported device level features */
0x0E,0x00, /* Speeds supported by the device : SS, HS and FS */
0x03, /* Functionality support */
0x00, /* U1 device exit latency */
0x00,0x00 /* U2 device exit latency */
};

/* Standard device qualifier descriptor */
const uint8_t CyFxUSBDeviceQualDscr[] __attribute__ ((aligned (32))) =
{
0x0A, /* descriptor size */
CY_U3P_USB_DEVQUAL_DESCR, /* Device qualifier descriptor type */
0x00,0x02, /* USB 2.0 */
0xEF, /* Device class */
0x02, /* Device sub-class */
0x01, /* Device protocol */
0x40, /* Maxpacket size for EP0 : 64 bytes */
0x01, /* Number of configurations */
0x00 /* Reserved */
};

/* Standard super speed configuration descriptor */
const uint8_t CyFxUSBSSConfigDscr[] __attribute__ ((aligned (32))) =
{
/* Configuration descriptor */
0x09, /* Descriptor size */
CY_U3P_USB_CONFIG_DESCR, /* Configuration descriptor type */

#ifndef USB_UAC_CLASS
0xD3,0x00, /* Length of this descriptor and all sub descriptors */ /*add 20210823,0xD3=211*/
0x02, /* Number of interfaces */
#else
0x34,0x01, /* Length of this descriptor and all sub descriptors */ /*add 20210823,0x134=211+97*/
//0x32,0x01,
0x04, /* Number of interfaces */
#endif

0x01, /* Configuration number */
0x00, /* COnfiguration string index */
0x80, /* Config characteristics - Bus powered */
0x32, /* Max power consumption of device (in 8mA unit) : 400mA */

/* Interface association descriptor */ /*add 20210823,usb Composite Device*/
0x08, /* Descriptor size */
CY_FX_INTF_ASSN_DSCR_TYPE, /* Interface association descr type */
0x00, /* I/f number of first VideoControl i/f */
0x02, /* Number of video streaming i/f */
0x0E, /* CC_VIDEO : Video i/f class code */
0x03, /* SC_VIDEO_INTERFACE_COLLECTION : Subclass code */
0x00, /* Protocol : Not used */
0x00, /* String desc index for interface */

#ifdef USB_UVC_CLASS /*add 20210823,uvc has 2 interface,one is VC(0),one is VS Alternate(1).two endpoint,VC endpoint is 2,VS endpoint is 3*/

/* Standard video control interface descriptor */
0x09, /* Descriptor size */
CY_U3P_USB_INTRFC_DESCR, /* Interface descriptor type */
0x00, /* Interface number */
0x00, /* Alternate setting number */
0x01, /* Number of end points */
0x0E, /* CC_VIDEO : Interface class */
0x01, /* CC_VIDEOCONTROL : Interface sub class */
0x00, /* Interface protocol code */
0x00, /* Interface descriptor string index */

/* Class specific VC interface header descriptor */
0x0D, /* Descriptor size: 13 bytes */
0x24, /* Class specific i/f header descriptor type */
0x01, /* Descriptor sub type : VC_HEADER */
0x10,0x01, /* Revision of class spec : 1.1 */
0x51,0x00, /* Total size of class specific descriptors (till output terminal) */
0x00,0x6C,0xDC,0x02, /* Clock frequency : 48MHz */
0x01, /* Number of streaming interfaces */
0x01, /* Video streaming i/f 1 belongs to VC i/f */

/* Input (camera) terminal descriptor */
0x12, /* Descriptor size: 18 bytes */
0x24, /* Class specific interface desc type */
0x02, /* Input Terminal Descriptor type */
0x01, /* ID of this terminal */
0x01,0x02, /* Camera terminal type */
0x00, /* No association terminal */
0x00, /* String desc index : Not used */
0x00,0x00, /* No optical zoom supported */
0x00,0x00, /* No optical zoom supported */
0x00,0x00, /* No optical zoom supported */
0x03, /* Size of controls field for this terminal : 3 bytes */
0x00,0x00,0x00, /* No controls supported */

/* Processing unit descriptor */
0x0D, /* Descriptor size: 13 bytes */
0x24, /* Class specific interface desc type */
0x05, /* Processing unit descriptor type */
0x02, /* ID of this terminal */
0x01, /* Source ID : 1 : connected to input terminal */
0x00,0x40, /* Digital multiplier */
0x03, /* Size of controls field for this terminal : 3 bytes */
0x00,0x00,0x00, /* No controls supported */
0x00, /* String desc index : Not used */
0x00, /* No analog modes supported. */

/* Extension unit descriptor */
0x1C, /* Descriptor size: 28 bytes */
0x24, /* Class specific interface desc type */
0x06, /* Extension unit descriptor type */
0x03, /* ID of this terminal */
0xFF,0xFF,0xFF,0xFF, /* 16 byte GUID */
0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,
0x00, /* Number of controls in this terminal */
0x01, /* Number of input pins in this terminal */
0x02, /* Source ID : 2 : connected to proc unit */
0x03, /* Size of controls field for this terminal : 3 bytes */
0x00,0x00,0x00, /* No controls supported */
0x00, /* String desc index : Not used */

/* Output terminal descriptor */
0x09, /* Descriptor size: 9 bytes */
0x24, /* Class specific interface desc type */
0x03, /* Output terminal descriptor type */
0x04, /* ID of this terminal */
0x01,0x01, /* USB streaming terminal type */
0x00, /* No association terminal */
0x03, /* Source ID : 3 : Connected to extn Unit */
0x00, /* String desc index : Not used */

/* Video control status interrupt endpoint descriptor */ /*add 20210823,after CY_U3P_USB_ENDPNT_DESCR,need a CY_U3P_SS_EP_COMPN_DESCR*/
0x07, /* Descriptor size */
CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
CY_FX_EP_CONTROL_STATUS, /* Endpoint address and description */
CY_U3P_USB_EP_INTR, /* Interrupt end point type */
0x40,0x00, /* Max packet size = 64 bytes */
0x01, /* Servicing interval */

/* Super speed endpoint companion descriptor */
0x06, /* Descriptor size */
CY_U3P_SS_EP_COMPN_DESCR, /* SS endpoint companion descriptor type */
0x00, /* Max no. of packets in a Burst : 1 */
0x00, /* Mult.: Max number of packets : 1 */
0x40,0x00, /* Bytes per interval : 64 */

/* Class specific interrupt endpoint descriptor */
0x05, /* Descriptor size */
0x25, /* Class specific endpoint descriptor type */
CY_U3P_USB_EP_INTR, /* End point sub type */
0x40,0x00, /* Max packet size = 64 */

/* Standard video streaming interface descriptor (Alternate setting 0) */
0x09, /* Descriptor size */
CY_U3P_USB_INTRFC_DESCR, /* Interface descriptor type */
0x01, /* Interface number */
0x00, /* Alternate setting number */
0x00, /* Number of end points : zero bandwidth */
0x0E, /* Interface class : CC_VIDEO */
0x02, /* Interface sub class : CC_VIDEOSTREAMING */
0x00, /* Interface protocol code : Undefined */
0x00, /* Interface descriptor string index */

/* Class-specific video streaming input header descriptor */
0x0E, /* Descriptor size: 14 bytes */
0x24, /* Class-specific VS i/f Type */
0x01, /* Descriptor subtype : input header */
0x01, /* 1 format desciptor follows */
0x37,0x00, /* Total size of class specific VS descr: 55 bytes */
CY_FX_EP_ISO_VIDEO, /* EP address for ISO video data */
0x00, /* No dynamic format change supported */
0x04, /* Output terminal ID : 4 */
0x00, /* No still image capture supported. */
0x00, /* No hardware trigger support. */
0x00, /* Hardware to initiate still image capture */
0x01, /* Size of controls field : 1 byte */
0x00, /* D2 : Compression quality supported */

/* Class specific VS format descriptor */
0x0B, /* Descriptor size: 11 bytes */
0x24, /* Class-specific VS i/f type */
0x06, /* Descriptor subtype : VS_FORMAT_MJPEG */
0x01, /* Format desciptor index */
0x01, /* 1 Frame desciptor follows */
0x01, /* Uses fixed size samples */
0x01, /* Default frame index is 1 */
0x00, /* Non interlaced stream not reqd. */
0x00, /* Non interlaced stream not reqd. */
0x00, /* Non interlaced stream */
0x00, /* CopyProtect: duplication unrestricted */

/* Class specific VS frame descriptor */
0x1E, /* Descriptor size: 30 bytes */
0x24, /* Class-specific VS i/f type */
0x07, /* Descriptor Subtype : VS_FRAME_MJPEG */
0x01, /* Frame desciptor index */
0x00, /* Still image capture method not supported */
0xB0,0x00, /* Width of the frame : 176 */
0x90,0x00, /* Height of the frame : 144 */
0x00,0xC0,0x5D,0x00, /* Min bit rate bits/s */
0x00,0xC0,0x5D,0x00, /* Max bit rate bits/s */
0x00,0x58,0x02,0x00, /* Maximum video or still frame size in bytes */
0x2A,0x2C,0x0A,0x00, /* Default frame interval */
0x01, /* Frame interval type : 1 discrete setting. */
0x2A,0x2C,0x0A,0x00, /* Min frame interval: 15 fps */

/* Standard video streaming interface descriptor (Alternate setting 1) */
0x09, /* Descriptor size */
CY_U3P_USB_INTRFC_DESCR, /* Interface descriptor type */
0x01, /* Interface number */
0x01, /* Alternate setting number */
0x01, /* Number of end points : 1 ISO EP */
0x0E, /* Interface class : CC_VIDEO */
0x02, /* Interface sub class : CC_VIDEOSTREAMING */
0x00, /* Interface protocol code : Undefined */
0x00, /* Interface descriptor string index */

/* Endpoint descriptor for ISO streaming video data */
0x07, /* Descriptor size */
CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
CY_FX_EP_ISO_VIDEO, /* Endpoint address and description */
CY_U3P_USB_EP_ISO | 0x04, /* ISO end point : Async */
0x00,0x04, /* Max packet size is 1024 bytes. */
0x01, /* Servicing interval for data transfers */

/* Super speed endpoint companion descriptor */
0x06, /* Descriptor size */
CY_U3P_SS_EP_COMPN_DESCR, /* SS endpoint companion descriptor type */
CY_FX_EP_ISO_VIDEO_SS_BURST - 1,/* Max no. of packets in a burst */
CY_FX_EP_ISO_VIDEO_SS_MULT - 1, /* Mult setting: Number of bursts per service interval. */
0x00, 0x04 * CY_FX_EP_ISO_VIDEO_PKTS_COUNT, /* Bytes per interval : 1024 */

#endif


#ifdef USB_UAC_CLASS /*add 20210823,UAC has 2 interface,one is AC(2),one is AS(3).one endpoint,AS endpoint is 1*/

/* Standard Audio Control Interface Descriptor */
0x09, /* Descriptor Size */
CY_U3P_USB_INTRFC_DESCR, /* Interface Descriptor Type */
0x02, /* Interface number */ /*add 20210823,modify 0x00 to 0x02*/
0x00, /* Alternate setting */
0x00, /* Number of endpoints - 0 endpoints */
0x01, /* Interface Class - Audio */
0x01, /* Interface SubClass - Audio Control */
0x00, /* Interface Protocol - Unused */
0x00, /* Interface string index */

/* Class Specific Audio Control Interface Descriptor */
0x09, /* Descriptor Size */
0x24, /* Descriptor Type - CS_INTERFACE */
0x01, /* Descriptor SubType - Header */
0x00, 0x01, /* Revision of class specification - 1.0 */
0x1E, 0x00, /* Total size of class specific descriptors */
0x01, /* Number of streaming Interfaces - 1 */
0x01, /* Audio Streaming interface 1 belongs to this AudioControl Interface */

/* Input terminal descriptor */
0x0C, /* Descriptor size in bytes */
0x24, /* CS Interface Descriptor */
0x02, /* Input Terminal Descriptor subtype */
0x01, /* ID Of the input terminal */
0x01, 0x02, /* Microphone - terminal type */
0x00, /* Association terminal - None */
0x02, /* Number of channels - 2 */
0x03, 0x00, /* spatial location of the logical channels - Front Left and Front Right */
0x00, /* Channel names - Unused */
0x00, /* String index for this descriptor - None */

/* Output terminal descriptor */
0x09, /* Descriptor size */
0x24, /* Class specific interface desc type */
0x03, /* Output terminal descriptor type */
0x02, /* ID of this terminal */
0x01, 0x01, /* Output terminal type: USB Streaming */
0x00, /* Association terminal - Unused */
0x01, /* Id of the terminal/unit to which this is connected - Input terminal id */
0x00, /* String desc index : Not used */

/* Standard Audio Streaming Interface Descriptor (Alternate setting 0) */
0x09, /* Descriptor size */
CY_U3P_USB_INTRFC_DESCR, /* Interface descriptor type */
0x03, /* Interface number */ /*add 20210823,modify 0x01 to 0x03*/
0x00, /* Alternate setting number */
0x00, /* Number of end points : zero bandwidth */
0x01, /* Interface class : Audio */
0x02, /* Interface sub class : Audio Streaming */
0x00, /* Interface protocol code : Unused */
0x00, /* Interface descriptor string index */

/* Standard Audio Streaming Interface descriptor (Alternate setting 1) */
0x09, /* Descriptor size */
CY_U3P_USB_INTRFC_DESCR, /* Interface descriptor type */
0x03, /* Interface number */ /*add 20210823,modify 0x01 to 0x03*/
0x01, /* Alternate setting number */
0x01, /* Number of end points : 1 ISO EP */
0x01, /* Interface Audio class */
0x02, /* Interface Audio sub class - Audio Streaming */
0x00, /* Interface protocol code : Unused */
0x00, /* Interface descriptor string index */

/* Class-specific Audio Streaming General Interface descriptor */
0x07, /* Descriptor size */
0x24, /* Class-specific AS i/f Type */
0x01, /* Descriptotor subtype : AS General */
0x02, /* Terminal Link - Output terminal id */
0x01, /* Interface delay */
0x01, 0x00, /* Audio data format - PCM */

/* Class specific AS Format descriptor - Type I Format Descriptor */
0x0B, /* Descriptor size */
0x24, /* Class-specific Interface Descriptor Type */
0x02, /* Format Type Descriptor subtype */
0x01, /* PCM FORMAT_TYPE_I */
0x02, /* Number of channels - 2 */
0x02, /* Subframe size - 2 bytes per audio subframe */
0x10, /* Bit resolution - 16 bits */
0x01, /* Number of samping frequencies - 1 */
0x80, 0xBB, 0x00, /* Sampling frequency - 48000 Hz */

/* Endpoint descriptor for ISO streaming Audio data */
0x09, /* Descriptor size */
//0x07,
CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
CY_FX_EP_ISO_AUDIO, /* Endpoint address and description */
0x05, /* ISO End point : Async */
0x60, 0x00, /* Transaction size - 96 bytes */
0x03, /* Servicing interval for data transfers */
0x00, /* bRefresh */
0x00, /* bSynchAddress */

/* Super speed endpoint companion descriptor */
0x06, /* Descriptor size */
CY_U3P_SS_EP_COMPN_DESCR, /* SS endpoint companion descriptor type */
0x00, /* Max no. of packets in a burst : 1 */
0x00, /* Mult.: Max number of packets : 1 */
0x60, 0x00, /* Bytes per interval : 1024 */

/* Class Specific AS Isochronous Audio Data Endpoint Descriptor */
0x07, /* Descriptor size in bytes */
0x25, /* CS_ENDPOINT descriptor type */
0x01, /* EP_GENERAL sub-descriptor type */
0x00, /* bmAttributes - None */
0x00, /* bLockDelayUnits - Unused */
0x00, 0x00 /* wLockDelay - unused */

#endif

};

in file of cyfxuvcdscr.c,the macro of USB_UVC_CLASS and USB_UAC_CLASS are defined。

0 Likes
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

Please try adding the IAD (interface association descriptor /* Interface association descriptor */) for the UAC interface as done for UVC interface and let me know if it helps. Please note that the interface number and interface class code in IAD should be according to UAC interface.

Regards,
Rashi
0 Likes
lock attach
Attachments are accessible only for community members.

I uploaded my descriptor file,added IAD just like you said in my cyfxuvcdesc.c, but my computer device manager as follow,

wyw_0-1629869729951.png

 

0 Likes
lock attach
Attachments are accessible only for community members.
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

Please find the attached example project with UVC + UAC interface. I have used AN75779 + USB Audio Class firmware of the SDK for the same. You can refer to the same for your application

Please note that I have only modified the USB superspeed descriptors. Also, the functions CyFxUacApplnStart/Stop are dummy and user can add the code according to the application

Regards,
Rashi
0 Likes
lock attach
Attachments are accessible only for community members.

Hi,as your attached example project,it ok.But I use example project of USBVideoClass(I don't need external camera),and added associated descriptors with UAC in cyfxuvcdscr.c,then refer to your attached example project modify USBVideoClass project,download image file to FX3,my device manager dispaly as follow.Finally,you can provide one project of USBVideoClass that support UAC function,or please check my project of USBVideoClass.

wyw_0-1630035530831.png

 

0 Likes
lock attach
Attachments are accessible only for community members.
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

Please test the attached firmware which enumerates as expected at my end

 

Regards,
Rashi
0 Likes

Hi,thanks for you.My computer could identify UVA and UAC device.

Compared the two projects,i found the filed of  "Audio Streaming interface"  in wy project was   0x01, and your project the filed is 0x03,this problem causes UAC enumeration to fail.

0 Likes
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

Yes, the Audio Streaming interface  belonging  to the AudioControl Interface should be updated based on the audio streaming interface number

Regards,
Rashi
0 Likes