path: root/firmware/usbstack
diff options
authorFrank Gevaerts <>2013-11-26 22:03:20 +0100
committerFrank Gevaerts <>2014-02-09 20:39:18 +0100
commitbde5394f5a4cc40478f28911cdcde6cec85f1b6d (patch)
tree751499deb477b44e0ceaa389e6ab57bbeb40cd34 /firmware/usbstack
parentf723ca58055a6acc7c4c2e8eff8709bd8fdc32b1 (diff)
Return a valid USB string descriptor for index 0xEE.
Windows will try to retrieve such a descriptor on first connect. If the device returns STALL or a regular string descriptor (i.e. not one that follows the Microsoft OS Descriptor spec), things will continue normally. Unfortunately some of our low-level USB drivers have issues with STALL so any other valid descriptor is the next best solution. Change-Id: I59eb09eea157e4e14bec0197a898be378a5559f2 Reviewed-on: Reviewed-by: Frank Gevaerts <> Tested: Frank Gevaerts <>
Diffstat (limited to 'firmware/usbstack')
1 files changed, 7 insertions, 0 deletions
diff --git a/firmware/usbstack/usb_core.c b/firmware/usbstack/usb_core.c
index e4ecc90e63..dc69628c13 100644
--- a/firmware/usbstack/usb_core.c
+++ b/firmware/usbstack/usb_core.c
@@ -643,6 +643,13 @@ static void request_handler_device_get_descriptor(struct usb_ctrlrequest* req)
size = usb_strings[index]->bLength;
ptr = usb_strings[index];
+ else if(index == 0xee) {
+ // We don't have a real OS descriptor, and we don't handle
+ // STALL correctly on some devices, so we return any valid
+ // string (we arbitrarily pick the manufacturer name)
+ size = usb_string_iManufacturer.bLength;
+ ptr = &usb_string_iManufacturer;
+ }
else {
logf("bad string id %d", index);
usb_drv_stall(EP_CONTROL, true, true);