Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > How to add a new HID interfaces in super speed?

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



How to add a new HID interfaces in super speed?
Moderator:
RSKV

Post Reply
Follow this topic



How to add a new HID interfaces in super speed?

Cyui posted on 06 Dec 2012 7:09 PM PST
Member
3 Forum Posts

Hi,

I add a new HID interface into UVC sample code,

(refer the "http://www.cypress.com/?rID=72422")

In USB2.0,  it's OK.  (windows device manager has detect a new HID device),

But in USB3.0, it's not work. windows device manager can't detect.

I only add the descriptor in spuer speed and high speed as below, 

Do I need add another descriptor in super speed?  Thanks.

--

/* Super Speed Configuration Descriptor */

#define HID

    /* Configuration Descriptor Type */
    0x09,                           /* Descriptor Size */
    CY_U3P_USB_CONFIG_DESCR,        /* Configuration Descriptor Type */
#ifdef HID
    0xF2,0x00,
    0x03,
#else
    0xD9,0x00,                      /* Length of this descriptor and all sub descriptors */
    0x02,                           /* Number of interfaces */
#endif
    0x01,                           /* Configuration number */
    0x00,                           /* Configuration string index */
    0x80,                           /* Config characteristics - Bus powered */
    //0xFA,                           /* Max power consumption of device (in 2mA unit) : 500mA */
    0x32,             

   ...

   ...

#ifdef HID
    /* New Interface descriptor */
    0x09,
    0x04,
    0x02,
    0x00,
    0x01,
    0x03,
    0x00,
    0x00,
    0x01,
    /* HID descriptor */
    0x09,
    0x21,
    0x01,0x01,
    0x00,
    0x01,
    0x22,
    0x22,0x00,
    /* endpoint descriptor */
    0x07,
    0x05,
    0x85,
    0x03,
    0x40,0x00,
    0x0A
#endif

 




Re: How to add a new HID interfaces in super speed?

Lumpi6 posted on 07 Dec 2012 11:04 PM PST
Top Contributor
183 Forum Posts

Hi Cyui,

I think you added your HID to both descriptors, the HS and the SS?

Did you add the correct value of max packet size in CyFxUSBSSConfigDscr? There you should set max packet size to 1024 for super speed!!!

/* UVC Video Streaming Endpoint Packet Size */
#define CY_FX_EP_BULK_VIDEO_PKT_SIZE    (0x400)  /* 1024 Bytes */
 

/* Low Byte - UVC Video Streaming Endpoint Packet Size */
#define CY_FX_EP_BULK_VIDEO_PKT_SIZE_L  (uint8_t)(CY_FX_EP_BULK_VIDEO_PKT_SIZE & 0x00FF)

/* High Byte - UVC Video Streaming Endpoint Packet Size and No. of BULK packets */
#define CY_FX_EP_BULK_VIDEO_PKT_SIZE_H  (uint8_t)((CY_FX_EP_BULK_VIDEO_PKT_SIZE & 0xFF00) >> 8)
 

 

        /* Endpoint Descriptor for BULK Streaming Video Data */
        0x07,                           /* Descriptor size */
        CY_U3P_USB_ENDPNT_DESCR,        /* Endpoint Descriptor Type */
        CY_FX_EP_BULK_VIDEO,             /* Endpoint address and description */
        CY_U3P_USB_EP_BULK,              /* BULK End point */
        CY_FX_EP_BULK_VIDEO_PKT_SIZE_L,  /* EP MaxPcktSize: 1024B */
        CY_FX_EP_BULK_VIDEO_PKT_SIZE_H,  /* EP MaxPcktSize: 1024B */
        0x01,                           /* Servicing interval for data transfers */
 

There is a difference between USB2.0 HS and USB3.0 SS. HS needs max packet size of 512 and SS 1024.

regards,

lumpi



Re: How to add a new HID interfaces in super speed?

Lumpi6 posted on 07 Dec 2012 11:04 PM PST
Top Contributor
183 Forum Posts

Hi Cyui,

I think you added your HID to both descriptors, the HS and the SS?

Did you add the correct value of max packet size in CyFxUSBSSConfigDscr? There you should set max packet size to 1024 for super speed!!!

/* UVC Video Streaming Endpoint Packet Size */
#define CY_FX_EP_BULK_VIDEO_PKT_SIZE    (0x400)  /* 1024 Bytes */
 

/* Low Byte - UVC Video Streaming Endpoint Packet Size */
#define CY_FX_EP_BULK_VIDEO_PKT_SIZE_L  (uint8_t)(CY_FX_EP_BULK_VIDEO_PKT_SIZE & 0x00FF)

/* High Byte - UVC Video Streaming Endpoint Packet Size and No. of BULK packets */
#define CY_FX_EP_BULK_VIDEO_PKT_SIZE_H  (uint8_t)((CY_FX_EP_BULK_VIDEO_PKT_SIZE & 0xFF00) >> 8)
 

 

        /* Endpoint Descriptor for BULK Streaming Video Data */
        0x07,                           /* Descriptor size */
        CY_U3P_USB_ENDPNT_DESCR,        /* Endpoint Descriptor Type */
        CY_FX_EP_BULK_VIDEO,             /* Endpoint address and description */
        CY_U3P_USB_EP_BULK,              /* BULK End point */
        CY_FX_EP_BULK_VIDEO_PKT_SIZE_L,  /* EP MaxPcktSize: 1024B */
        CY_FX_EP_BULK_VIDEO_PKT_SIZE_H,  /* EP MaxPcktSize: 1024B */
        0x01,                           /* Servicing interval for data transfers */
 

There is a difference between USB2.0 HS and USB3.0 SS. HS needs max packet size of 512 and SS 1024.

regards,

lumpi



Re: How to add a new HID interfaces in super speed?

Cyui posted on 10 Dec 2012 12:24 AM PST
Member
3 Forum Posts

Hi,

Thanks for reply , but I already set max packet size to 1024 for super speed,

and if don't add a new HID interface, UVC works well. (Both SS and HS)

When add a new HID interface, HID and UVC will not detected in super speed,

But in high speed, HID and UVC can detected.

Maybe is HID descriptor incorrect makes FX3 don't work?

 

 



Re: How to add a new HID interfaces in super speed?

Lumpi6 posted on 10 Dec 2012 02:37 AM PST
Top Contributor
183 Forum Posts

Hi Cyui,

in superspeed descriptors all enpoint descriptors have a companion descriptor with the max num of packets per burst,...!

This is missing in your configuration descriptor of your added HID endpoint. Add this too!

#ifdef HID
        ,
        /* New Interface descriptor */
    0x09,
    0x04,
    0x02,
    0x00,
    0x01,
    0x03,
    0x00,
    0x00,
    0x01,

    /* HID descriptor */
    0x09,
    0x21,
    0x01,0x01,
    0x00,
    0x01,
    0x22,
    0x22,0x00,

    /* endpoint descriptor */
    0x07,
    0x05,
    0x85,
    0x03,
    0x40,0x00,
    0x0A
        /* Super Speed Endpoint Companion Descriptor */
        0x06,                           /* Descriptor size */
        CY_U3P_SS_EP_COMPN_DESCR,       /* SS Endpoint Companion Descriptor Type */
        0x0F,                           /* Max number of packets per burst: 16 */
        0x00,                           /* Attribute: Streams not defined */
        0x00,                           /* No meaning for bulk */
        0x00
#endif
 

and you also have to change the length from

        0xF2,0x00,//242                      /* Length of this descriptor and all sub descriptors */
 

to

        0xF2+6,0x00,//242                      /* Length of this descriptor and all sub descriptors */

regards,

lumpi



Re: How to add a new HID interfaces in super speed?

Cyui posted on 12 Dec 2012 10:39 PM PST
Member
3 Forum Posts

Hi Lumpi6,


Yes, you're right.

When I add the SS endpoint companion descriptor,

It can be detected, both UVC and HID.

But I have modify some value as below,


/* Super Speed Endpoint Companion Descriptor */
        0x06,                         
        CY_U3P_SS_EP_COMPN_DESCR,     
        0x00,                         
        0x00,                         
        0x00,                         
        0x04


Thank you very much~



Re: How to add a new HID interfaces in super speed?

Lumpi6 posted on 12 Dec 2012 07:58 AM PST
Top Contributor
183 Forum Posts

Hi Cyui,

great that it works ;-) you're welcome. I thought about that, that you may setup the values like you are using the descriptor... . It was just an example.

regards,

lumpi






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.