I recently got this working. Here's what I had to do.
- Change the device descriptors .bcdUSB field to 0x0210. 0x0200 and 0x0110 won't work if you want to use Microsoft's OS 2.0 descriptors.
- In `usb_handle_setup_packet` you have to handle more cases than just `USB_DIR_OUT` and `USB_DIR_IN`. You need to handle the case where `pkt->bmRequestType` is `0xC0`. Print out the fields of `pkt` to see what Windows is doing when you plug in your Pico.
- In the `descriptor_type` switch statement, you need to handle the `case 0x0F:` for getting the BOS descriptor. You might also need to handle `case 0x06:` which is the Device Qualifier Descriptor.
- Then you need to send the descriptors back to the host, which is a major PITA to get right. https://github.com/newaetech/naeusb/blob/main/wcid.md helped me get that sorted.
- Finally, you'll find that you need to send more than 64 bytes back to the host. To do that, you will need to modify `ep0_in_handler` to repeatedly send any remaining bytes, when the data to be sent exceeds 64 bytes.
Statistics: Posted by JinShil — Wed Jun 12, 2024 8:41 am