none
Bluetooth LE HID device collection error RRS feed

  • Question

  • Hello I am developing an embedded HID device which gives me an error when connected:

    This device cannot start. (Code 10)

    Extra end collection found or end collection not found.

    This seems to be a problem with my Report Map, but according to HID tool it is fine:

    char ReportDescriptor[52] = {
        0x05, 0x01,                    // USAGE_PAGE (Generic Desktop)
        0x09, 0x02,                    // USAGE (Mouse)
        0xa1, 0x01,                    // COLLECTION (Application)
        0x09, 0x01,                    //   USAGE (Pointer)
        0xa1, 0x00,                    //   COLLECTION (Physical)
        0x85, 0x01,                    //     REPORT_ID (1)
        0x05, 0x09,                    //     USAGE_PAGE (Button)
        0x19, 0x01,                    //     USAGE_MINIMUM (Button 1)
        0x29, 0x03,                    //     USAGE_MAXIMUM (Button 3)
        0x15, 0x00,                    //     LOGICAL_MINIMUM (0)
        0x25, 0x01,                    //     LOGICAL_MAXIMUM (1)
        0x95, 0x03,                    //     REPORT_COUNT (3)
        0x75, 0x01,                    //     REPORT_SIZE (1)
        0x81, 0x02,                    //     INPUT (Data,Var,Abs)
        0x95, 0x01,                    //     REPORT_COUNT (1)
        0x75, 0x05,                    //     REPORT_SIZE (5)
        0x81, 0x03,                    //     INPUT (Cnst,Var,Abs)
        0x05, 0x01,                    //     USAGE_PAGE (Generic Desktop)
        0x09, 0x30,                    //     USAGE (X)
        0x09, 0x31,                    //     USAGE (Y)
        0x15, 0x81,                    //     LOGICAL_MINIMUM (-127)
        0x25, 0x7f,                    //     LOGICAL_MAXIMUM (127)
        0x75, 0x08,                    //     REPORT_SIZE (8)
        0x95, 0x02,                    //     REPORT_COUNT (2)
        0x81, 0x06,                    //     INPUT (Data,Var,Rel)
        0xc0,                          //   END_COLLECTION
        0xc0                           // END_COLLECTION
    };

    Any ideas?

    Tuesday, February 21, 2017 10:43 AM

Answers

  • Thank you for your help :)

    After examining the data collectedwith logman i noticed the Report Map was received reversed, so reversing the Report Map structure solved it. The endianess was the culprit here. Thanks again.

    /Björn

    Thursday, February 23, 2017 1:29 PM

All replies

  • Which OS build are you using  - version and build number ?

    I tested the report descriptor using the HID vhidmini2 minidriver sample - https://github.com/Microsoft/Windows-driver-samples/tree/master/hid and it seems to be fine. So its possible that some portion of it is somehow getting truncated ? Have you checked to see if the report descriptor right before it is transmitted over the air - if that also matches the report descriptor you posted, we will need to collect Bluetooth traces.

    Tuesday, February 21, 2017 10:44 PM
  • Thank you for replying :)

    I am using Windows 10 - version 1607 build 14393.693

    I am using a BlueNRG-ms, and it is reporting the correct characteristic value right before i connect.

    I have examined the event viewer abit more since i wrote the original post and i found this when i connect

    Device (0x280E1003C2A) is not Compliant with the Bluetooth Core Specification: previous attribute was a (Characteristic), current attribute is a (Descriptor).

     I found this in the event viewer, device manager doesnt report any errors with the bluetooth connection though, only with the HID device "Bluetooth LE GATT compliant HID Device". This happens even with their default implementation(basic GAP and GATT server), so I have started a thread on their forum for that issue. I am guessing this could be part of the problem but i dont know if it is related as I can connect fine if I do not have any HID service running, but still get not compliant message in logs.

    What kind of Bluetooth traces should I do? It would be really nice if i could see how the descriptor looks when on the Windows side




    Tuesday, February 21, 2017 11:12 PM
  • Logging

    In an elevated command prompt:

    logman create trace "bth_hci" -ow -o c:\bth_hci.etl -p {8a1f9517-3a8c-4a9e-a018-4f17a200f277} 0xffffffffffffffff 0xff -nb 16 16 -bs 1024 -mode Circular -f bincirc -max 4096 -ets
    // repro your issue
    logman stop "bth_hci" -ets

    Conversion

    The BtEtlParse.exe is in WDK 10

    Ensure the bth_hci.etl is in a folder you can write too (so Admin if C:\ or copy it to do it as a user).

    In the command prompt:

    btetlparse C:\bth_hci.etl
    Wednesday, February 22, 2017 10:25 PM
  • Thank you for your help :)

    After examining the data collectedwith logman i noticed the Report Map was received reversed, so reversing the Report Map structure solved it. The endianess was the culprit here. Thanks again.

    /Björn

    Thursday, February 23, 2017 1:29 PM
  • There appears to be a "Heisenbug" in that driver. I have a MS bluetooth keyboard that after no use for 5-10 minutes would cause my Win10 system to freeze for 30 seconds, sometimes multiple times in a row. I have been able to reproduce this with two different Bluetooth receivers. I enabled the WPP trace logging that you specified, and I haven't seen the problem since then. Any ideas Arvind?

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting. Blog at www.azius.com/blog

    Saturday, February 25, 2017 11:15 PM
    Moderator
  • I finally got the system to freeze today when my keyboard had been asleep for several hours. I stopped the log and ran btetlparse on my 23MB ETL file. It created a 2.8MB CFA file and an empty TXT file. Now what?

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting. Blog at www.azius.com/blog

    Monday, February 27, 2017 3:10 AM
    Moderator
  • Can you put the ETL file on a OneDrive (or other) share and post a link ?
    Wednesday, March 1, 2017 7:52 PM
  • Here is a link to the file: https://1drv.ms/u/s!AnHYCbebxUCpu889Neki3zB-apJakw

    Why doesn't your tool decode it? Even Message Analyzer has a problem with some of the events

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting. Blog at www.azius.com/blog

    Wednesday, March 1, 2017 8:15 PM
    Moderator