Ports and Interfaces > USB

USBCV HID Descriptor error

<< < (2/5) > >>

jdunne:
Jan,

You were right!  HID Descriptor tool that you linked to contains a parser.  I never realized it before.  The main reason I hadn't noticed the parser is because I never use the tool because its such a piece of junk to actually use to manually create report descriptors. 

Anyway, having discovered that it contains a parser I wanted to import my ridiculously large report descriptor (1200 bytes) into DT's proprietary .HID format.  I wrote up a quick and dirty parser this morning that parses a .c source descriptor and converts it to the .HID format.  This allows a pre-existing report descriptor to be imported into the descriptor tool for debugging.

I'd like to post the source and application, but it appears your site doesn't allow attachments.  Any suggestions where or how to post it?  Otherwise I guess I'll post it on Microchip's forum and link to that.  I'd like to share my tool so others can benefit from it.

Joe

Jan Axelson:
I've re-enabled attachments.

Jan

jdunne:
From the readme.txt

HID Descriptor tool import tool
The version 2.4 HID descriptor tool from usb.org tragically doesn't contain an import .c file functionality.
It only supports its own proprietary .hid file format (which fortunately is fairly simple).
This tool is written in VB6.

This tool imports a .c file containing only the report descriptor and outputs a .hid file containing the descriptors
imported.  Note that DT.exe will choke when trying to parse the descriptor unless actually COPY the .HID file to the
folder where the dt.exe tool is located.

Limitations of the tool:  (I threw this together in 2 hours, so don't expect perfection)

1. The tool properly ignores // comment lines and BLANK lines, but does not support C style comments /* */ Remove C style comments if they are used in your application.
2. The tool looks for a comma to determine if the line contains data.  (It isn't exactly all that intelligent of a parser) This usually means you'll have to add a comma to the LAST line of your descriptor definition for the tool to find it properly.  (See the example)
3. The tool only supports ONE ITEM PER LINE!!  So, if you've got 0xC0, 0xC0 on a single line to end 2 collections, the tool will FAIL to import that line.

Enjoy.

Joe

[attachment deleted by admin]

jdunne:
Hello,

Having used my newly created tool to import my report descriptors into the HID report descriptor tool from usb.org, I've now solved my problems, which turned out that I had my logical minimum defined larger than my logical maximum for a few report items.

Also, the cryptic error message from USB20CV:

--- Code: ---External report descriptor parser 0x200 warnings
External report descriptor parser 0xA errors
(3.2.61) The report descriptor returned in response to a GetDescriptor(Report)
 must be compliant with the HID specification.
--- End code ---

As it turns out, the line that reads "External report descriptor parser 0xA errors" actually means there are 0x0A == 10 (TEN) errors in my report descriptor.  The hex formatting threw me off.  I guess that they have another formatting issue because the 0x200 warnings actually means there are 2 (TWO) warnings.

Hopefully this information helps somebody down the road.  I have wasted a day of my life on this mess.

Joe

jdunne:

By the way, the .hid file output from my tool needs to be copied to the same folder as the dt.exe file otherwise dt.exe throws a bunch of errors when trying to load it.


Joe

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version