embeddedhidatmelgamepad

Is there another step I am missing with HID gamepads?


I am running a ItsyBitsy M0 board with a custom firmware using the ATMEL start (HID GENERIC).

When I run the firmware as default the device shows up in the device manager with no errors. Since its just running the generic hid example nothing more comes from that.

When I run with my own custom report descriptor the device shows up in the device manager but with a yellow exclamation point. (error 10 in input.inf). Since the descriptor was written for a gamepad I was hoping to see it in the gamepad settings screen.

When I look at the packets sent through with wireshark all I see is windows requesting the descriptior and my device responding with my descriptor multiple times... as if windows did not like what it got and asked for it again.

I've looked over the descriptor and cant see what's wrong with it. I'm 90% certain there is something wrong with it though. But also maybe there is something with the underlying USB layer that I need to change to make it a gamepad as well?

Here is my descriptor: *Edit: In my tiredness I gave you the wrong "more complicated" descriptor. That I intend to use. I will edit it to be more exact in what I want.

    0x05, 0x01, //Usage Page (Generic Desktop Ctrls)
    0x09, 0x08, // Usage (Multi Axis)
    0xA1, 0x01, // Collection (Application)
    0x85, 0x01,     //REPORT_ID(1)
    0x05, 0x02,     //Usage Page (Simulation Controls)
    0x15, 0x00,     //LOGICAL_MINIMUM (0)
    0x27, 0xFF,
    0xFF, 0x00,
    0x00,           //LOGICAL_MAXIMUM (65535)
    0x75, 0x10,     // REPORT_SIZE (16)
    0x95, 0x01,     // REPORT_COUNT (1)
    0xA1, 0x00,     //COLLECTION (PHYSICAL)
    0x09, 0xBA,         //USAGE RUDDER
    0x81, 0x02,         //INPUT (Data,Var,Abs)
    0xC0,           //END_COLLECTION (Physical)
    0xC0        //END_COLLECTION (Application)

Did you revert your descriptor to the values of the default? Was the device accepted then?

I did do that and it worked. The problem is that Atmel decided to use the vender specified usage page so the second I try to move that into the generic desktop space I get the same problem. Here is the original example they gave me:

0x06, 0xFF, 0xFF,  // Usage Page (Vendor Defined 0xFFFF)
0x09, 0x01,        // Usage (0x01)
0xA1, 0x01,        // Collection (Application)
0x09, 0x02,        //   Usage (0x02)
0x09, 0x03,        //   Usage (0x03)
0x15, 0x00,        //   Logical Minimum (0)
0x26, 0xFF, 0x00,  //   Logical Maximum (255)
0x75, 0x08,        //   Report Size (8)
0x95, 0x40,        //   Report Count (64)
0x81, 0x02,        //   Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x09, 0x04,        //   Usage (0x04)
0x09, 0x05,        //   Usage (0x05)
0x15, 0x00,        //   Logical Minimum (0)
0x26, 0xFF, 0x00,  //   Logical Maximum (255)
0x75, 0x08,        //   Report Size (8)
0x95, 0x40,        //   Report Count (64)
0x91, 0x02,        //   Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0x09, 0x06,        //   Usage (0x06)
0x09, 0x07,        //   Usage (0x07)
0x15, 0x00,        //   Logical Minimum (0)
0x26, 0xFF, 0x00,  //   Logical Maximum (255)
0x75, 0x08,        //   Report Size (8)
0x95, 0x04,        //   Report Count (4)
0xB1, 0x02,        //   Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0xC0,              // End Collection

Hopefully my simpler descriptor, without buttons, may help (or it may just announce a different problem)

Thanks in advance for your help.


Solution

  • I figured this out. For anyone who may have this problem in the future:

    In the USB layer there is a HID field in the configuration response that includes the interface descriptors. In there is another field labeled "HID DESCRIPTOR" that describes the length of HID descriptor that will be requested in the future.

    Once I found and changed the #define that has that length to match my new report descriptor it worked perfectly.

    Thank you all for your help.