USB device stack

Dependents:   mbed-mX-USB-TEST1 USBMSD_SD_HID_HelloWorld HidTest MIDI_usb_bridge ... more

Issue: Descriptor Strings Repeating in SimpleHIDWrite

The USBDevice library is reporting it's 6 strings repeatedly starting on every requested index that is a multiple of 16. This is made evident by using the Generic HID example program (with updated libraries of course), launching SimpleHIDWrite, selecting the device, and clicking Info:

/media/uploads/neilt6/usb_string_bug.jpg

I've determined this to be caused by the DESCRIPTOR_INDEX macro in USBDevice_Types.h, which is defined as (wValue & 0xf). By only preserving the lower 4 bits, the requested index is allowed to roll over to 0 on every multiple of 16. It should instead be defined as (wValue & 0xff), which preserves the entire index byte.

Example program

1 comment:

21 Jan 2014

I've submitted a pull request that fixes this issue, please refer to it here: http://mbed.org/users/mbed_official/code/USBDevice/pull-request/3