Skip to content

Commit a46addb

Browse files
authored
Fix stdio_usb with reset interface disabled on Windows (#1857)
* Only use bcdUSB = 0x0200 with MS_OS_20 descriptor enabled * Add comment
1 parent bc598ff commit a46addb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/rp2_common/pico_stdio_usb/stdio_usb_descriptors.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,15 @@
9292
static const tusb_desc_device_t usbd_desc_device = {
9393
.bLength = sizeof(tusb_desc_device_t),
9494
.bDescriptorType = TUSB_DESC_DEVICE,
95+
// On Windows, if bcdUSB = 0x210 then a Microsoft OS 2.0 descriptor is required, else the device won't be detected
96+
// This is only needed for driverless access to the reset interface - the CDC interface doesn't require these descriptors
97+
// for driverless access, but will still not work if bcdUSB = 0x210 and no descriptor is provided. Therefore always
98+
// use bcdUSB = 0x200 if the Microsoft OS 2.0 descriptor isn't enabled
99+
#if PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE && PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_MS_OS_20_DESCRIPTOR
95100
.bcdUSB = 0x0210,
101+
#else
102+
.bcdUSB = 0x0200,
103+
#endif
96104
.bDeviceClass = TUSB_CLASS_MISC,
97105
.bDeviceSubClass = MISC_SUBCLASS_COMMON,
98106
.bDeviceProtocol = MISC_PROTOCOL_IAD,

0 commit comments

Comments
 (0)