dmitrystu / libusb_stm32

Lightweight USB device Stack for STM32 microcontrollers
Apache License 2.0
713 stars 163 forks source link

The HID device does not work on Windows #43

Closed MohammedNoureldin closed 5 years ago

MohammedNoureldin commented 5 years ago

Hi,

I connected my device (on which the the demo firmware is flashed), but the device worked only on Linux but not on Windows. I am not sure why. This is the error I get on Windows events log (these messages are copied from different events to give more info):

Device USB\VID_0483&PID_5740&MI_02\7&118ad3aa&0&0002 had a problem starting. Device USB\VID_0483&PID_5740&MI_02\7&118ad3aa&0&0002 was not migrated due to partial or ambiguous match. This device cannot start. (Code 10) Report Descriptor was not byte aligned.

Do you have an idea how to fix it?

Maybe showing my Linux output (which seems to work pretty well) may help? This is how my output in my Linux syslog looks like (the mouse moves circularly as supposed in the demo):

Jun 30 21:07:32 raspberrypi kernel: [31711.932127] usb 1-1.4.2: new full-speed USB device number 7 using dwc_otg Jun 30 21:07:32 raspberrypi kernel: [31712.168976] usb 1-1.4.2: New USB device found, idVendor=0483, idProduct=5740, bcdDevice= 1.00 Jun 30 21:07:32 raspberrypi kernel: [31712.168993] usb 1-1.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=254 Jun 30 21:07:32 raspberrypi kernel: [31712.169003] usb 1-1.4.2: Product: CDC Loopback demo Jun 30 21:07:32 raspberrypi kernel: [31712.169012] usb 1-1.4.2: Manufacturer: Open source USB stack for STM32 Jun 30 21:07:32 raspberrypi kernel: [31712.169021] usb 1-1.4.2: SerialNumber: 5682CFA2 Jun 30 21:07:32 raspberrypi kernel: [31712.174320] input: Open source USB stack for STM32 CDC Loopback demo as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4.2/1-1.4.2:1.2/0003:0483:5740.0006/input/input9 Jun 30 21:07:32 raspberrypi kernel: [31712.182877] hid-generic 0003:0483:5740.0006: input,hidraw2: USB HID v1.00 Mouse [Open source USB stack for STM32 CDC Loopback demo] on usb-3f980000.usb-1.4.2/input2 Jun 30 21:07:32 raspberrypi mtp-probe: checking bus 1, device 7: "/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4.2" Jun 30 21:07:32 raspberrypi mtp-probe: bus: 1, device: 7 was not an MTP device Jun 30 21:07:32 raspberrypi kernel: [31712.238869] cdc_acm 1-1.4.2:1.0: ttyACM0: USB ACM device Jun 30 21:07:32 raspberrypi kernel: [31712.241358] usbcore: registered new interface driver cdc_acm Jun 30 21:07:32 raspberrypi kernel: [31712.241374] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters Jun 30 21:07:33 raspberrypi systemd-udevd[1719]: Process '/usr/sbin/th-cmd --socket /var/run/thd.socket --passfd --udev' failed with exit code 1. Jun 30 21:07:33 raspberrypi systemd-udevd[1720]: Process '/usr/sbin/th-cmd --socket /var/run/thd.socket --passfd --udev' failed with exit code 1. Jun 30 21:07:33 raspberrypi mtp-probe: checking bus 1, device 7: "/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4.2" Jun 30 21:07:33 raspberrypi mtp-probe: bus: 1, device: 7 was not an MTP device Jun 30 21:08:08 raspberrypi kernel: [31748.232050] usb 1-1.4.2: USB disconnect, device number 7

MohammedNoureldin commented 5 years ago

Thanks a lot, this worked perfectly!

If I am not wrong, I do need more than the last commit? because I added the changes on the descriptor from the last commit but that did not work until I took the last 4 commits.