This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

USB HID example, size problems .. again and again

Hi all

first of all thanks to Tsuneo Chinzei for contributing here that much. Very helpful. THANK YOU !! I am afraid my question finally will end up there top;)

So, here is the common problem, wanting to increase msg sizes. read around here a lot and obeyed all the hints, but still failing.

I am using the Std Keil XP Client, except that I converted it back to VC 6 and added minor overlapped support (works fine for 1 byte msgs)

First I used the simplified report desciptor TC provided , together with one byte msgs -> Still OK

const BYTE HID_ReportDescriptor[] = {
  HID_UsagePageVendor(0x00),
  HID_Usage(0x01),
  HID_Collection(HID_Application),
    HID_LogicalMin(0),             // value range: 0 - 0xFF
    HID_LogicalMaxS(0xFF),
    HID_ReportSize(8),             // 8 bits
    HID_ReportCount(1),            // one byte
    HID_Usage(0x01),
    HID_Input(HID_Data | HID_Variable | HID_Absolute),
    HID_Usage(0x01),
    HID_Output(HID_Data | HID_Variable | HID_Absolute),
  HID_EndCollection,
};

I modified the wMaxPacketSize to 0x40 , still OK

Then I set the Report Count to 60 Bytes. Inspection with HID Device Exerciser shows device now with 61 bytes, as expected. (in both directions)

Next step is to modify the VC program to reflect the report changes, so setting both i+o structres to 61 bytes. WriteFile is Ok, but ReadFile always hangs.

Looking ant the many threads here about this particular topic , it would really have been a good idea to provide such a sample? Hello ? KEIL ?!?!? someone reading here ?!?!

Even harder to understand is: How can they ship a broken product like they do with ULINK 2 . Using the inspector shows a completely broken string table, as is in all the samples here too. Again - thanks TC , that can be fixed, but why do they ship such broken stuff ?

Parents
  • Hi, Tsuneo

    what a surprise to meet you here in the end;) You have no idea how grateful I am. Just think of the string table hints. THANK THANK you very MUCH !

    I did indeed looked at Axel's page, (a fine source of inspiration by the way) but unfortunately I don't have access to the neccessary ddk files to get it compiled.

Reply
  • Hi, Tsuneo

    what a surprise to meet you here in the end;) You have no idea how grateful I am. Just think of the string table hints. THANK THANK you very MUCH !

    I did indeed looked at Axel's page, (a fine source of inspiration by the way) but unfortunately I don't have access to the neccessary ddk files to get it compiled.

Children
  • "unfortunately I don't have access to the neccessary ddk files to get it compiled."

    For VC6, use this headers and libraries.

    Excerpt HID and Setup header/library from Win2k DDK
    www.intel.com/.../FromDDK.htm
    (a support page for "USB Design by Example" by John Hyde from Intel Press)

    Tsuneo

  • THANX

    It turned out that something in the XP prog is wrong - no idea what (up to now). Will try to find that out.
    BTW the idea to put in the Vendor and Product ID into the source is fine .. BUT .. you then have to add that for the variables too, otherwise they remain at their default value ;)) took me a moment to find out why device detection always failed.

    usbhidioc.cpp
    
    
            //These are the vendor and product IDs to look for.
            //Uses Lakeview Research's Vendor ID.
            int VendorID = xxxx;
            int ProductID = xxxx;