Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > HID descriptor

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



HID descriptor

Summary: 5106 Views, 1 Replies, Latest reply by Vytautas2 on 02 Mar 2012 07:59 AM PST

Verified Answers: 0

Post Reply


Vytautas2 posted on 02 Mar 2012 2:10 AM PST
Top Contributor
36 Forum Posts

Hi,

I try to implement composite device that has two interfaces. Second interface should work as HID. See config descriptor below. The problem is that if I add HID descriptor, then during connection firmware is asked for device, config, string descriptors (visible in debug output), but everything ends up with unknown device (VID_0000, PID_0000). If I leave 1th interface class as 0x03, remove HID descriptor, but leave endpoints, then Windows detect composite and HID, but displays that HID cannot be started.

Where I should add HID descriptor (to config descriptor or separately) ? How to return HID and report descriptor ? I do not see where firmware is asked for it althoug I have debug output from callbacks CyU3PUsbRegisterSetupCallback(AppUsbSetupCB,CyFalse) and CyU3PUsbRegisterEventCallback(AppUsbEventCB).

Setup requests are processed manually and descriptors are returned manually (without using CyU3PUsbSetDesc) like in sample cyfxbulklpautoenum.
Thanks.
---
// High Speed Configuration Descriptor
const uint8_t CyFxUSBHSConfigDscr[] =
{
// Configuration Descriptor Type
0x09,                           // Descriptor Size
CY_U3P_USB_CONFIG_DESCR,        // Configuration Descriptor Type
0x40,0x00,                      // Length of this descriptor and all sub descriptors
0x02,                           // Number of interfaces
0x01,                           // Configuration number
0x00,                           // COnfiguration string index
0x80,                           // Config characteristics - Bus powered
0x64,                           // Max power consumption of device (in 2mA unit)
 
// 0th Interface Descriptor
0x09,                           // Descriptor size
CY_U3P_USB_INTRFC_DESCR,        // Interface Descriptor type
0x00,                           // Interface number
0x00,                           // Alternate setting number
0x02,                           // Number of end points
0xFF,                           // Interface class
0x00,                           // Interface sub class
0x00,                           // Interface protocol code
0x00,                           // Interface descriptor string index
 
// 0th interface EP1 interrupt IN
0x07,                           // Descriptor size
CY_U3P_USB_ENDPNT_DESCR,        // Endpoint descriptor type
CY_FX_EP1_INT,            // Endpoint address and description
CY_U3P_USB_EP_INTR,             // Interrupt endpoint type
0x00,0x04,                      // Max packet size = 1024 bytes
0x01,                           // Servicing interval for data transfers
 
// 0th interface EP2 isochronous IN
0x07,                           // Descriptor size
CY_U3P_USB_ENDPNT_DESCR,        // Endpoint Descriptor Type
CY_FX_EP2_ISO,            // Endpoint address and description
CY_U3P_USB_EP_ISO,              // Iso End point Type
    0x00,0x04,                      // Max packet size = 1024 bytes
0x01,                            // Servicing interval for data transfers
 
// 1th Interface Descriptor
0x09,                           // Descriptor size
CY_U3P_USB_INTRFC_DESCR,        // Interface Descriptor type
0x01,                           // Interface number
0x00,                           // Alternate setting number
0x02,                           // Number of end points
0x03,                           // Interface class
0x00,                           // Interface sub class
0x00,                           // Interface protocol code
0x00,                           // Interface descriptor string index
 
    // HID Descriptor
0x09, // bLength
CY_U3P_USB_HID_DESCR, // bDescriptorType
0x01, 0x00, // bcdHID
0x00, // bCountryCode
0x01, // bNumDescriptors
CY_U3P_USB_REPORT_DESCR, // bDescriptorType
0x41, 0x00, // wDescriptorLength
 
// 1th interface EP1 interrupt IN
0x07,                           // Descriptor size
CY_U3P_USB_ENDPNT_DESCR,        // Endpoint descriptor type
CY_FX_INT1EP1_INT,        // Endpoint address and description
CY_U3P_USB_EP_INTR,             // Interrupt endpoint type
    0x40,0x00,                      // Max packet size = 64 bytes
0x10,                           // Servicing interval for data transfers
 
// 1th interface EP2 interrupt OUT
0x07,                           // Descriptor size
CY_U3P_USB_ENDPNT_DESCR,        // Endpoint descriptor type
CY_FX_INT1EP2_INT,        // Endpoint address and description
CY_U3P_USB_EP_INTR,             // Interrupt endpoint type
    0x40,0x00,                      // Max packet size = 64 bytes
0x01                            // Servicing interval for data transfers
};
 



 

Vytautas2 posted on 02 Mar 2012 07:59 AM PST
Top Contributor
36 Forum Posts

It turned out that in the case of composite device must install Cypress driver for another non-HID device in order to start receiving HID-related setup events in firmware and then pass report descriptor and report. If installation of non-HID device driver is cancelled, then also HID device does not work.

If device is not composite, but HID alone, then firmware starts to receive HID-related events after automatical installation of Microsoff HID drivers.

 



 

Post Reply






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.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 06/15/20