Ports
May 22, 2013, 09:53:26 am
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: SMF - Just Installed!
Home
Help
Search
Login
Register
Welcome to the PORTS Forum. Please post your questions, answers, and comments relating to USB and other hardware interfaces in the appropriate forums below. - Jan
Ports
>
General Category
>
USB
>
Adding a report to an HID Descriptor
Pages: [
1
]
« previous
next »
Print
Author
Topic: Adding a report to an HID Descriptor (Read 1252 times)
rallysjd
Member
Posts: 15
Adding a report to an HID Descriptor
«
on:
March 22, 2012, 08: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, 09:22:38 am by rallysjd
»
Logged
Jan Axelson
Administrator
Frequent Contributor
Posts: 1629
Re: Adding a report to an HID Descriptor
«
Reply #1 on:
March 22, 2012, 11:57:07 am »
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
Logged
rallysjd
Member
Posts: 15
Re: Adding a report to an HID Descriptor
«
Reply #2 on:
March 22, 2012, 01: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
Logged
Jan Axelson
Administrator
Frequent Contributor
Posts: 1629
Re: Adding a report to an HID Descriptor
«
Reply #3 on:
March 22, 2012, 03:51:03 pm »
Did you do what I suggested above?
Jan
Logged
rallysjd
Member
Posts: 15
Re: Adding a report to an HID Descriptor
«
Reply #4 on:
March 23, 2012, 11:01:17 am »
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
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> USB
=> Serial Ports
=> Embedded Ethernet
=> Parallel Port
=> Other Interfaces
=> General Discussion
Loading...