Hi, i currently work with an Arm Controller from ST and i try to create a CDC + HID usb interface device.
The configuration is working under XP but on Win7 only the Com Port is visible, the keyboard is not detected. While sniffing the usb communication i found out that the device descriptor is read correct (like on XP) but the HID report descriptor is not read by win7. Does anybody have an idea what is the problem?
Here is the driver i used:
; ; STMicroelectronics Comunication Device Class driver instalation file ; (C)2006 Copyright STMicroelectronics ; [Version] Signature="$Windows NT$" Class=Ports ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318} Provider=%STM% LayoutFile=layout.inf DriverVer=10/02/06 [Manufacturer] %STM%=DeviceList [DestinationDirs] DefaultDestDir=12 [SourceDisksFiles] [SourceDisksNames] [DeviceList] %DESCRIPTION%=STMUSB, USB\VID_0483&PID_A097&MI_00 ;------------------------------------------------------------------------------ ; Windows 2000/XP Sections ;------------------------------------------------------------------------------ [STMUSB.nt] include=mdmcpq.inf CopyFiles=DriverCopyFiles AddReg=STMUSB.nt.AddReg [DriverCopyFiles] usbser.sys,,,0x20 [STMUSB.nt.AddReg] HKR,,DevLoader,,*ntkern HKR,,NTMPDriver,,usbser.sys HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" [STMUSB.nt.Services] AddService=usbser, 0x00000002, DriverService [STMUSB.nt.HW] include=mdmcpq.inf [DriverService] DisplayName=%DESCRIPTION% ServiceType=1 StartType=3 ErrorControl=1 ServiceBinary=%12%\usbser.sys ;------------------------------------------------------------------------------ ; String Definitions ;------------------------------------------------------------------------------ [Strings] STM="STMicroelectronics" DESCRIPTION="Datafox Virtual COM Port"
_ALIGN_BEGIN uint8_t usbd_cdc_CfgDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIGN_END = { /*------------------------------------------------------------------------*/ /*Configuration Descriptor*/ /*------------------------------------------------------------------------*/ 0x09,0x02,0x4B,0x00,0x03,0x01,0x00,0xC0,0x32, //--------------------------------------------------------------------------- // Interface Association Descriptor //--------------------------------------------------------------------------- 0x08,0x0B,0x00,0x02,0x02,0x02,0x01,0x04, /*---------------------------------------------------------------------------*/ /*Interface Descriptor 1 */ //--------------------------------------------------------------------------- 0x09,0x04,0x00,0x00,0x01,0x02,0x02,0x01,0x04, //--------------------------------------------------------------------------- /*Header Functional Descriptor*/ //--------------------------------------------------------------------------- 0x05,0x24,0x00,0x10,0x01, //--------------------------------------------------------------------------- /*Call Management Functional Descriptor*/ //--------------------------------------------------------------------------- 0x05,0x24,0x01,0x00,0x03, //--------------------------------------------------------------------------- /*ACM Functional Descriptor*/ //--------------------------------------------------------------------------- 0x04,0x24,0x02,0x06, //--------------------------------------------------------------------------- /*Union Functional Descriptor*/ //--------------------------------------------------------------------------- 0x05,0x24,0x06, 0x00,0x01, //--------------------------------------------------------------------------- /*Endpoint 2 Descriptor*/ //--------------------------------------------------------------------------- 0x07,0x05,0x83, 0x03,LOBYTE(CDC_CMD_PACKET_SZE1),HIBYTE(CDC_CMD_PACKET_SZE1), 0xFF, /*---------------------------------------------------------------------------*/ /*Data class interface descriptor 1*/ //--------------------------------------------------------------------------- 0x09,0x04,0x01,0x00,0x02,0x0A,0x00,0x00,0x04, //--------------------------------------------------------------------------------- /*Endpoint OUT Descriptor*/ //--------------------------------------------------------------------------------- 0x07,0x05,0x01, 0x02,LOBYTE(CDC_DATA_MAX_PACKET_SIZE1), HIBYTE(CDC_DATA_MAX_PACKET_SIZE1), /* 065 */ 0x00, //--------------------------------------------------------------------------------- /*Endpoint IN Descriptor*/ //--------------------------------------------------------------------------------- 0x07,0x05,0x81, 0x02,LOBYTE(CDC_DATA_MAX_PACKET_SIZE1), HIBYTE(CDC_DATA_MAX_PACKET_SIZE1), 0x00, ////------------------------------------------------------------- ///************** Interface Descriptor Keyboard ****************/ ////------------------------------------------------------------- 0x09, USB_INTERFACE_DESCRIPTOR_TYPE, 0x02, 0x00, 0x01, 0x03, 0x01, 0x01, 0x00, ////---------------------------------------------------------------- ///**************** HID Descriptor Keyboard ********************/ ////---------------------------------------------------------------- 0x09,0x21,0x11,0x01,0x00,0x01,0x22,0x3F,0x00, ////------------------------------------------------------------------------- ///******************** Descriptor of Keyboard endpoint ********************/ ////------------------------------------------------------------------------- 0x07,0x05,0x82,0x03,0x08,0x00,0x0A, //---------------------------------------------------------------------------
continue...
//--------------------------------------------------------------------------- /*Header Functional Descriptor*/ //--------------------------------------------------------------------------- 0x05, /* 025 bLength: Endpoint Descriptor size */ 0x24, /* 026 bDescriptorType: CS_INTERFACE */ 0x00, /* 027 bDescriptorSubtype: Header Func Desc */ 0x10, /* 028 bcdCDC: spec release number */ 0x01, /* 029 */ //--------------------------------------------------------------------------- /*Call Management Functional Descriptor*/ //--------------------------------------------------------------------------- 0x05, /* 030 bFunctionLength */ 0x24, /* 031 bDescriptorType: CS_INTERFACE */ 0x01, /* 032 bDescriptorSubtype: Call Management Func Desc */ 0x00, /* 033 bmCapabilities: D0+D1 */ 0x03, /* 034 bDataInterface: 1 */ //--------------------------------------------------------------------------- /*ACM Functional Descriptor*/ //--------------------------------------------------------------------------- 0x04, /* 035 bFunctionLength */ 0x24, /* 036 bDescriptorType: CS_INTERFACE */ 0x02, /* 037 bDescriptorSubtype: Abstract Control Management desc */ 0x06, /* 038 bmCapabilities */ //--------------------------------------------------------------------------- /*Union Functional Descriptor*/ //--------------------------------------------------------------------------- 0x05, /* 039 bFunctionLength */ 0x24, /* 040 bDescriptorType: CS_INTERFACE */ 0x06, /* 041 bDescriptorSubtype: Union func desc */ 0x00, /* 042 bMasterInterface: Communication class interface */ 0x01, /* 043 bSlaveInterface0: Data Class Interface */ //--------------------------------------------------------------------------- /*Endpoint 2 Descriptor*/ //--------------------------------------------------------------------------- 0x07, /* 044 bLength: Endpoint Descriptor size */ USB_ENDPOINT_DESCRIPTOR_TYPE (0x05), /* 045 bDescriptorType: Endpoint */ CDC_CMD_EP1 (0x83), /* 046 bEndpointAddress */ 0x03, /* 047 bmAttributes: Interrupt */ LOBYTE(CDC_CMD_PACKET_SZE1) (0x08), /* 048 wMaxPacketSize: */ HIBYTE(CDC_CMD_PACKET_SZE1) (0x00), /* 049 */ 0xFF, /* 050 bInterval: */ /*---------------------------------------------------------------------------*/ /*Data class interface descriptor 1*/ //--------------------------------------------------------------------------- 0x09, /* 051 bLength: Endpoint Descriptor size */ USB_INTERFACE_DESCRIPTOR_TYPE (0x04), /* 052 bDescriptorType: */ 0x01, /* 053 bInterfaceNumber: Number of Interface */ 0x00, /* 054 bAlternateSetting: Alternate setting */ 0x02, /* 055 bNumEndpoints: Two endpoints used */ 0x0A, /* 056 bInterfaceClass: CDC */ 0x00, /* 057 bInterfaceSubClass: */ 0x00, /* 058 bInterfaceProtocol: */ 0x04, /* 059 iInterface: */ //--------------------------------------------------------------------------------- /*Endpoint OUT Descriptor*/ //--------------------------------------------------------------------------------- 0x07, /* 060 bLength: Endpoint Descriptor size */ USB_ENDPOINT_DESCRIPTOR_TYPE (0x05), /* 061 bDescriptorType: Endpoint */ CDC_OUT_EP1 (0x01), /* 062 bEndpointAddress */ 0x02, /* 063 bmAttributes: Bulk */ LOBYTE(CDC_DATA_MAX_PACKET_SIZE1) (0x40, /* 064 wMaxPacketSize: */ HIBYTE(CDC_DATA_MAX_PACKET_SIZE1) (0x00), /* 065 */ 0x00, /* 066 bInterval: ignore for Bulk transfer */ //--------------------------------------------------------------------------------- /*Endpoint IN Descriptor*/ //--------------------------------------------------------------------------------- 0x07, /* 067 bLength: Endpoint Descriptor size */ USB_ENDPOINT_DESCRIPTOR_TYPE (0x05), /* 068 bDescriptorType: Endpoint */ CDC_IN_EP1 (0x81), /* 069 bEndpointAddress */ 0x02, /* 070 bmAttributes: Bulk */ LOBYTE(CDC_DATA_MAX_PACKET_SIZE1) (0x40),/* 071 wMaxPacketSize: */ HIBYTE(CDC_DATA_MAX_PACKET_SIZE1) (0), /* 072 */ 0x00, /* 073 bInterval: ignore for Bulk transfer */
Best regards,
Matthew
////------------------------------------------------------------- ///************** Interface Descriptor Keyboard ****************/ ////------------------------------------------------------------- 0x09, /* bLength: Interface Descriptor size */ USB_INTERFACE_DESCRIPTOR_TYPE (0x04), /* bDescriptorType: Interface descriptor type */ 0x02, /* bInterfaceNumber: Number of Interface*/ 0x00, /* bAlternateSetting: Alternate setting ## fix */ 0x01, /* bNumEndpoints */ 0x03, /* bInterfaceClass: HID fix */ 0x01, /* bInterfaceSubClass : 1=BOOT, 0=no boot ## fix */ 0x01, /* nInterfaceProtocol : 0=none, 1=keyboard, 2=mouse*/ 0x00, /* iInterface: Index of string descriptor*/ ////---------------------------------------------------------------- ///**************** HID Descriptor Keyboard ********************/ ////---------------------------------------------------------------- 0x09, /* bLength: HID Descriptor size ## fix - no change*/ 0x21, /* bDescriptorType: HID ## fix - no change*/ 0x11, /* bcdHID: HID Class Spec release number ##fix no change */ 0x01, /* High Byte of HID Class Spec number */ 0x00, /* bCountryCode: Hardware target country*/ 0x01, /* bNumDescriptors: Number of HID class descriptors to follow*/ 0x22, /* bDescriptorType fix -no change*/ 0x3F, /* wItemLength: Total length of Report descriptor*/ 0x00, /* High Byte of wItemLength */ ////------------------------------------------------------------------------- ///******************** Descriptor of Keyboard endpoint ********************/ ////------------------------------------------------------------------------- 0x07, /* bLength: Endpoint Descriptor size*/ 0x05, /* bDescriptorType: ## fix 0x05 */ HID_IN_EP (0x82), /* bEndpointAddress: Endpoint Address (IN)*/ 0x03, /* bmAttributes: Interrupt endpoint*/ 0x08, /* wMaxPacketSize: 8 Byte for keyboard transfer */ 0x00, /* High Byte of wMaxPacketSize */ 0x0A