arduino-libraries / Keyboard

GNU Lesser General Public License v3.0
231 stars 160 forks source link

Nano33 IoT #41

Closed tikonen closed 2 years ago

tikonen commented 3 years ago

Hi,

Should this library (and Mouse) work on Nano33 IoT? It compiles and links fine but the USB device does not work at least on Windows. What I get is weird broken composite device with two CDC (COM port) devices.

I bought this board based on few articles in the Webs that state native-USB HID support. Maybe this was false information? Looking closer I believe Arduino never claimed anywhere to support USB HID core on this specific board but it states here https://www.arduino.cc/reference/en/language/functions/usb/keyboard/ that "The keyboard functions enable 32u4 or SAMD micro based boards to send keystrokes to an attached computer through their micro’s native USB port."

Thank you!

facchinm commented 3 years ago

Hi @tikonen , on Windows the driver situation for composite devices is a mess. If your board has already been recognized as single CDC at least once the only thing you can do is uninstalling its driver and let Windows repeat the installation on its own (see https://github.com/arduino/ArduinoCore-samd/issues/423#issuecomment-615093627). Let me know if it works

tikonen commented 3 years ago

Thank you for prompt reply, I'll look into the linked issue.

PaulStoffregen commented 3 years ago

@facchinm - You should be able to solve this by just increasing the BCD version number in the device descriptor. Windows will automatically re-detect the device when it sees the same device with a new BCD version number.

tikonen commented 3 years ago

Looks like there is no way to uninstall driver. The device is recognized as common composite device and uses built-in drivers. I've attached picture of device manager and USB device dump.txt of the device. You can see there is a broken CDC device with HID descriptor.

Device Manager

facchinm commented 3 years ago

@facchinm - You should be able to solve this by just increasing the BCD version number in the device descriptor. Windows will automatically re-detect the device when it sees the same device with a new BCD version number.

That's definitely something I have to investigate, thanks for the hint!

@tikonen you shouldn't uninstall the composite device, only the serial "association" with Arduino CDC driver (the device showings as Nano33 IoT)

tikonen commented 3 years ago

@tikonen you shouldn't uninstall the composite device, only the serial "association" with Arduino CDC driver (the device showings as Nano33 IoT)

I tried that just now, the only difference is that the COM /CDC device port order reversed in USB descriptor.

facchinm commented 3 years ago

So HID part of the composite device is not recognized at all? Can you send a screenshot of the whole device manager?

tikonen commented 3 years ago

Now it works! I had forgot to tick the checkbox "Delete the driver software for this device" when uinstalling the driver. Windows always silently reused the samd driver.

per1234 commented 2 years ago

Closing as duplicate of https://github.com/arduino/ArduinoCore-samd/issues/423