zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.48k stars 6.41k forks source link

WebUSB sample not recognized correctly in Windows 10 #59457

Closed maxd-nordic closed 1 year ago

maxd-nordic commented 1 year ago

Describe the bug Automatic driver installation does not work for the WebUSB sample. It just gets assigned the null GUID and is shown with a warning triangle. Zadig also shows that the device did not get the correct WICD. On Linux, the WebUSB stuff seems to work fine, so I presume this is mostly related to the MS OS 2.0 descriptors / BOS entry. The MS OS 1.0 stuff seems to be irrelevant for anything newer than Windows 7.

To Reproduce

Expected behavior The WinUSB driver should be installed automatically, the device should not be should with a warning symbol in the device manager. The GUID should be reported correctly.

Impact This is a showstopper for me since it prevents me from implementing my current project: A Zephyr implementation of CMSIS-DAP v2. The automatic driver installation part is mandatory to conform to the spec.

Environment (please complete the following information):

github-actions[bot] commented 1 year ago

Hi @maxd-nordic! We appreciate you submitting your first issue for our open-source project. 🌟

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. πŸ€–πŸ’™

carlescufi commented 1 year ago

This is a showstopper for me since it prevents me from implementing my current project: A Zephyr implementation of CMSIS-DAP v2. The automatic driver installation part is mandatory to conform to the spec.

Have you seen this? https://github.com/zephyrproject-rtos/zephyr/pull/53798

maxd-nordic commented 1 year ago

Yes, I'm trying to finish that one for Johann. :)

tmon-nordic commented 1 year ago

The problem is definitely in MS OS 2.0 descriptor. One of the issue is that https://github.com/zephyrproject-rtos/zephyr/blob/c6c93e394d6a52c4541d39135681fc81b8df7dd5/samples/subsys/usb/webusb/src/main.c#L40 hardcodes the first interface index to 0x02 while the sample when built for nrf52840dk_nrf52840 has only one interface with number 0.

Changing the index itself doesn't seem to be enough though.

maxd-nordic commented 1 year ago

This fixes the issue: https://github.com/zephyrproject-rtos/zephyr/pull/59758

github-actions[bot] commented 1 year ago

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.