Author Topic: Adding a report to an HID Descriptor  (Read 15968 times)

rallysjd

  • Member
  • ***
  • Posts: 21
    • PiXCL Automation Technologies Inc
Adding a report to an HID Descriptor
« on: March 22, 2012, 09:49:17 am »
I have some HID firmware and a Windows HidDemo EXE in source from ST Micro, which work together perfectly on my hardware. The Report Descriptor table includes OUTPUTS (3 LEDs on one endpoint) and INPUTs (3 board keys on another endpoint). My the first task is to add another key INPUT.

Looking through "USB Complete (4th Ed)" I see and understand the global item types. It's simple enough to add another key INPUT section, based on the existing entries. The size of the Report Descriptor table is adjusted according to the new report table size (211 from 191 bytes).

With the original f/w, the Windows EXE calls SetupDiEnumDeviceInterfaces successfully. With the new f/w, the device appears to Windows (seemingly) correctly according to several USB utiliies I have, but the call to SetupDiEnumDeviceInterfaces fails (error 259, "No more Information").

It seems to me that
a) perhaps the additional report count has to be stored somewhere else. I have looked in all the related f/w sources, but cannot see anything obvious; or/and  
b) the enumeration is failing because something is wrong with the Report Descriptor table
 
If I understand correctly, adding another report does not need another EndPoint, as the number of reports is obtained when the Report Descriptor is parsed/queried (via the call to SetupDiEnumDeviceInterfaces ?).

I'm at a loss where to look next. Can you suggest what might be the problem here?

« Last Edit: March 22, 2012, 10:22:38 am by rallysjd »

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Adding a report to an HID Descriptor
« Reply #1 on: March 22, 2012, 12:57:07 pm »
Do this after changing descriptors:

From Windows Device Manager, uninstall the device. Then remove and reattach it.

Also see:

http://www.lvr.com/forum/index.php?topic=772.msg2967#msg2967

Jan

rallysjd

  • Member
  • ***
  • Posts: 21
    • PiXCL Automation Technologies Inc
Re: Adding a report to an HID Descriptor
« Reply #2 on: March 22, 2012, 02:30:32 pm »
Hello Jan,
thanks for the fast reply. I have a partial answer that raises (of course) more questions. 
 In my CustomHID_DeviceDescriptor after the VID/PID is bcdDevice. This has to be 0x0200. I had changed it to 0x0310 as a test ... the updated f/w now works. Does it have to match bcdUSB, also 0x0200?

Related to this ...  Reports 1-4 are the OUTPUT LEDs, Reports 5-8 are the INPUT keys, and Report 9 is an ADC input.

I expected that the host app would send / receive reports according to the new numbers. Oddly, the ADC input is still #7, as with the orginal f/w. Two of the key reports don't have other code to back them up which may be related. The number of FeatureData Indices is still 8, not the expected 9.


Suggestions?

SD

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Adding a report to an HID Descriptor
« Reply #3 on: March 22, 2012, 04:51:03 pm »
Did you do what I suggested above?

Jan

rallysjd

  • Member
  • ***
  • Posts: 21
    • PiXCL Automation Technologies Inc
Re: Adding a report to an HID Descriptor
« Reply #4 on: March 23, 2012, 12:01:17 pm »
Yes, I did try that. I have solved the problem, which was that the interrrupt code to link to all KEY reports was not present. Once that was fixed and the report numbers synced with the interrupt code, the device was accessible with the new f/w code.  I surmise that the enumeration protocol was breaking somehow. The result was that Device Manager was unable to identify the board as an HID Compliant device.

SD