HID class for simple data exchange

Hi ,

I have a usb protocol layer question,

I want to have a simple data exchange between PC and my usb device (for example I just want to send a hex data such as x"56" from PC to USB device and receive same byte by PC over a loop back), so I decided to config my device as a "usb HID class" device.

as I understood, "report descriptor" is necessary when the device is mouse, keyboard, etc. now my question is that, is necessary to send report descriptor in my custom application too?

 

below is the configuration descriptors that I used. but device cann't start properly (code 10 error) and there is a yellow mark next to the device name(in windows device manager).

--32 Bytes configuration
X"09"& -- bLength = 9 bytes
X"02"& -- bDescriptorType = configuration descriptor
X"29"& X"00"& -- wTotalLength = 39 bytes
X"01"& -- bNumInterfaces = 1
X"01"& -- bConfigurationValue = 1
X"00"& -- iConfiguration = none
X"80"& -- bmAttributes=Bus Powered
X"00"& -- bMaxPower = mA
-- 9 bytes interface descriptor (HID class)
X"09"& -- bLength = 9 bytes
X"04"& -- bDescriptorType = interface descriptor
X"00"& -- bInterfaceNumber = 0
X"00"& -- bAlternateSetting = 0
X"02"& -- bNumEndpoints = 1
X"03"& -- bInterfaceClass = HID Interface
X"00"& -- bInterfaceSubClass = none
X"00"& -- bInterafceProtocol = none
X"00"& -- iInterface = none
-- 9 bytes HID descriptor
X"09"& -- bLength = 9 bytes
X"21"& -- bDescriptorType = HID descriptor
X"0002" & -- bcdHID= 1.10 or 2.00
X"00"& -- bCountryCode = Setting this item to 0x00 tells the host that the device was not designed to be localized to any country.
X"00"& -- bNumDescriptors :This item tells the host how many report descriptors are contained in this HID configuration.
X"00"& -- dDescriptorType = the first descriptor which will follow the transfer of this HID descriptor is report descriptor.
X"0000"& -- wItemLength (total length of report descriptor)

-- 7 bytes endpoint descriptor ()
X"07"& -- bLength = 7 bytes
X"05"& -- bDescriptorType = endpoint descriptor
X"81"& -- bEndpointAddress = IN endpoint (D7), first endpoint (D0)/
X"03"& -- bmAttributes =interrupt /
X"40"& X"00"& -- wMaxPacketSize = 512 bytes
X"10"& -- bInterval
-- 7 bytes endpoint descriptor ()
X"07"& -- bLength = 7 bytes
X"05"& -- bDescriptorType = endpoint descriptor
X"01"& -- bEndpointAddress = out endpoint (D7), first endpoint (D1)/
X"03"& -- bmAttributes = interrupt/
X"40"& X"00"& -- wMaxPacketSize = 512 bytes
X"10"& -- bInterval

any idea would be greatly appreciated.

Thanks.

  • Roya,

    Is the device you are trying to connect to a "mouse, keyboard, etc."? If so then you need the "report descriptor"
    Also, if there is a warning in your device manager, then the device may be improperly installed/registered with Windows.

    I hope this helps.

    Mike Clements
    RenesasRulz Moderator
  • This thread will be archived due to inactivity.

    Mike Clements
    RenesasRulz Moderator