Page 1 of 1

Problem when changing usbHidReportDescriptor

Posted: Fri Jan 06, 2012 1:58 am
by Micha
Hello,

i have a usbHidReportDescriptor that looks like the following and works, that means the device is recognized and initialized by WinXP.

Code: Select all

PROGMEM char usbHidReportDescriptor[USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH] = {
    0x05, 0x01,                    // USAGE_PAGE (Generic Desktop)
    0x0b, 0x01, 0x00, 0x00, 0xff,  // USAGE (Vendor Defined Page 1:Vendor Usage 1)
    0xa1, 0x01,                    // COLLECTION (Application)
    0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
    0x26, 0xff, 0x00,              //   LOGICAL_MAXIMUM (255)
    0x75, 0x08,                    //   REPORT_SIZE (8)
    0x85, 0x01,                    //   REPORT_ID
    0x95, 0x06,                    //   REPORT_COUNT (6)
    0x09, 0x00,                    //   USAGE (Undefined)
    0x82, 0x00, 0x01,              //   INPUT (Data,Ary,Abs,Buf)
    0x85, 0x02,                    //   REPORT_ID
    0x95, 0x01,                    //   REPORT_COUNT (1)
    0x09, 0x00,                    //   USAGE (Undefined)
    0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
    0x85, 0x03,                    //   REPORT_ID
    0x95, 0x06,                    //   REPORT_COUNT (6)
    0x09, 0x00,                    //   USAGE (Undefined)
    0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
    0x85, 0x04,                    //   REPORT_ID
    0x95, 0x01,                    //   REPORT_COUNT (1)
    0x09, 0x00,                    //   USAGE (Undefined)
    0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
    0x85, 0x05,                    //   REPORT_ID
    0x95, 0x06,                    //   REPORT_COUNT (6)
    0x09, 0x00,                    //   USAGE (Undefined)
    0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
    0x85, 0x06,                    //   REPORT_ID
    0x95, 0x02,                    //   REPORT_COUNT (2)
    0x09, 0x00,                    //   USAGE (Undefined)
    0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
    0x85, 0x07,                    //   REPORT_ID
    0x95, 0x0A,                    //   REPORT_COUNT (10)
    0x09, 0x00,                    //   USAGE (Undefined)
    0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
    0x85, 0x08,                    //   REPORT_ID
    0x95, 0x01,                    //   REPORT_COUNT (1)
    0x09, 0x00,                    //   USAGE (Undefined)
    0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
#if USE_BOOTLOADER
    0x85, 0x09,                    //   REPORT_ID
    0x95, 0x01,                    //   REPORT_COUNT (1)
    0x09, 0x00,                    //   USAGE (Undefined)
    0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
#endif
    0x85, 0x32,                    //   REPORT_ID
    0x95, 0x0B,                    //   REPORT_COUNT (11)
    0x09, 0x00,                    //   USAGE (Undefined)
    0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
    0x85, 0x33,                    //   REPORT_ID
    0x95, 0x06,                    //   REPORT_COUNT (6)
    0x09, 0x00,                    //   USAGE (Undefined)
    0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
    0x85, 0x34,                    //   REPORT_ID
    0x95, 0x01,                    //   REPORT_COUNT (1)
    0x09, 0x00,                    //   USAGE (Undefined)
    0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
    0x85, 0x35,                    //   REPORT_ID
    0x95, 0x06,                    //   REPORT_COUNT (6)
    0x09, 0x00,                    //   USAGE (Undefined)
    0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
    0x85, 0x36,                    //   REPORT_ID
    0x95, 0x04,                    //   REPORT_COUNT (4)
    0x09, 0x00,                    //   USAGE (Undefined)
    0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
#if USE_IRSND_CAPABILITY
    0x85, 0x37,                    //   REPORT_ID
    0x95, 0x01,                    //   REPORT_COUNT (1)
    0x09, 0x00,                    //   USAGE (Undefined)
    0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
#endif
    0xc0                           // END_COLLECTION
};

This works well as long as USE_IRSND_CAPABILITY is set to 0. As soon as it's set to 1 (regardless of the setting of USE_BOOTLOADER) it doesn't work any more. In the device manager I can see a yellow exclamation mark and when I click onto the device it tells me something about a code-10 error.

lss-output with USE_IRSND_CAPABILITY = 0 -> working

Code: Select all

00000149 <usbDescriptorHidReport>:
     149:   05 01 0b 01 00 00 ff a1 01 15 00 26 ff 00 75 08     ...........&..u.
     159:   85 01 95 06 09 00 82 00 01 85 02 95 01 09 00 b2     ................
     169:   02 01 85 03 95 06 09 00 b2 02 01 85 04 95 01 09     ................
     179:   00 b2 02 01 85 05 95 06 09 00 b2 02 01 85 06 95     ................
     189:   02 09 00 b2 02 01 85 07 95 0a 09 00 b2 02 01 85     ................
     199:   08 95 01 09 00 b2 02 01 85 09 95 01 09 00 b2 02     ................
     1a9:   01 85 32 95 0b 09 00 b2 02 01 85 33 95 06 09 00     ..2........3....
     1b9:   b2 02 01 85 34 95 01 09 00 b2 02 01 85 35 95 06     ....4........5..
     1c9:   09 00 b2 02 01 85 36 95 04 09 00 b2 02 01 c0 00     ......6.........
   ...

lss-output with USE_IRSND_CAPABILITY = 1 -> not working

Code: Select all

00000149 <usbDescriptorHidReport>:
     149:   05 01 0b 01 00 00 ff a1 01 15 00 26 ff 00 75 08     ...........&..u.
     159:   85 01 95 06 09 00 82 00 01 85 02 95 01 09 00 b2     ................
     169:   02 01 85 03 95 06 09 00 b2 02 01 85 04 95 01 09     ................
     179:   00 b2 02 01 85 05 95 06 09 00 b2 02 01 85 06 95     ................
     189:   02 09 00 b2 02 01 85 07 95 0a 09 00 b2 02 01 85     ................
     199:   08 95 01 09 00 b2 02 01 85 09 95 01 09 00 b2 02     ................
     1a9:   01 85 32 95 0b 09 00 b2 02 01 85 33 95 06 09 00     ..2........3....
     1b9:   b2 02 01 85 34 95 01 09 00 b2 02 01 85 35 95 06     ....4........5..
     1c9:   09 00 b2 02 01 85 36 95 04 09 00 b2 02 01 85 37     ......6........7
     1d9:   95 01 09 00 b2 02 01 c0 00                          .........

Does anyone have an idea what could cause this problem or have any experience with it?

Strangely the problem also appears when I remove a report ID (e.g. ID 0x32).

Re: Problem when changing usbHidReportDescriptor

Posted: Sat Jan 07, 2012 1:27 am
by Micha
I did some more testing: meanwhile it seems to me that either the number of reports (report IDs) or the length of the desriptor is limited. When I remove one report I can set USE_IRSND_CAPABILITY to 1, so the last sentence in my last post it not true.

Can anyone imagine or confirm such a limitation?

Re: Problem when changing usbHidReportDescriptor

Posted: Fri Jan 13, 2012 5:53 pm
by Daid
Well, USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH should not be larger then 255 I can say you that with a quick glance at the code. But I don't think you have crossed that limit. Other then that I don't know...

Re: Problem when changing usbHidReportDescriptor

Posted: Thu Jan 26, 2012 3:11 am
by Grendel
The lenght of the report descriptor changed. Maybe forgot to change the RD lenght in the configuration descriptor ?