1
\$\begingroup\$

I'm working on a microcontroller project that should be programmable via USB. I chose the CH32V003 microcontroller as it's cheap and I thought a USB bootloader exists: https://github.com/cnlohr/rv003usb

Turns out I had multiple issues and now I doubt this is even possible with Windows.

The bootloader presents itself as a USB HID device and expects communication via USB feature reports. The supplied flasher, minichlink, found the device but was not able send any USB feature reports. https://github.com/cnlohr/rv003usb/issues/24#issuecomment-1777202095

It was clearly a software issue, I used Wireshark and a Logic analyzer to look for any USB packets on the wire. There were none.

I dug deeper and tried to use WebUSB and WebHID as well as hidapitester to send feature reports, but all failed (writing -1 bytes) https://github.com/cnlohr/rv003usb/issues/24#issuecomment-1826845787

Since 3 different software approaches failed to send feature reports (and I've tried on 3 different PCs) to the bootloader, I thought I should try with other hardware.
So I got myself an Arduino Pro Micro and used hidapitesters reference test firmware: https://github.com/todbot/hidapitester/tree/main/test_hardware/ProMicroRawHID

And again, it also failed. I can write out reports to the device, but feature reports again fail: https://github.com/todbot/hidapitester/issues/27

I also tried sending feature reports to random USB Mice, didn't work either.

By now I'm really stuck and don't know what to do. There are obviously people using feature reports to communicate with USB devices. But regardless how hard I try, this is something that seems to be impossible - at least on Windows.

Since my linked issues don't get responses I need more help.

Is it possible to send USB feature reports to a USB device on Windows 10? I tried to research this but I can't find an answer...

\$\endgroup\$
2
  • \$\begingroup\$ What is wMaxPacketSize for your bootloader HID? Does it enumerate under Windows? \$\endgroup\$ Commented Dec 13, 2023 at 3:41
  • \$\begingroup\$ @Ale..chenski yes wMaxPacketSize was an issue in the bootloader (it is 0x40 which is not possible for a low-speed device) and caused it to not even enumerate properly in windows. This is discussed in detail in the 2nd link I posted (issue#24) and is solved by basically changing it to 0x08. However, I have the same issue with the firmware that hidapitester provides. It's not only the bootloader that causes the issue... \$\endgroup\$ Commented Dec 13, 2023 at 21:31

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.