Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Support for boot protocol #42

Open
bitboy85 opened this issue Nov 30, 2020 · 6 comments
Open

[Feature Request] Support for boot protocol #42

bitboy85 opened this issue Nov 30, 2020 · 6 comments
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@bitboy85
Copy link

By now the library does not support boot protocol for keyboard which makes it impossible to use it on certain devices like KVM switches or in older pc bios.

This request might require additional changes in the used hid or usb libraries

@per1234 per1234 added the type: enhancement Proposed improvement label Nov 30, 2020
@T-vK
Copy link

T-vK commented Jan 27, 2021

Is this actually a thing? Do you have a link? Maybe this is related to the fact that some keyboards have the ability to fall back to PS/2 through the USB connector? https://en.wikipedia.org/wiki/PS/2_port#Conversion_between_PS/2_and_USB

@bitboy85
Copy link
Author

bitboy85 commented Jan 28, 2021

As asked i add a few links as reference.
HID-Project from NicoHood supports boot protocol, but its not working in all cases
NicoHood/HID#34
NicoHood/HID#225

https://deskthority.net/wiki/USB

USB specs
https://usb.org/sites/default/files/hid1_11.pdf mainly page 59. boot protocol also needs 2 additional functions to let the host know about "boot mode"

There are also a few questions in the forum about this topic.

In short: the current keyboard lib is not working in some cases. It is a software issue as i found out that a teensy with the same chip as an arduino micro, is always working, like a real keyboard.

@T-vK
Copy link

T-vK commented Jan 28, 2021

Very interesting, thanks for the links. I wasn't aware that the teeny has the same chip as the Arduino Micro. I wonder if it would be possible to flash the Teensy firmware onto the Micro in order to get it to work.

@T-vK
Copy link

T-vK commented Jan 28, 2021

Seems like "boot mode" is simply a difference in the HID device descriptor.

https://github.com/NicoHood/HID/blob/64b89df10c6ceb4fac492bcf66434edf95059dd8/src/SingleReport/BootKeyboard.cpp
vs
https://github.com/arduino-libraries/Keyboard/blob/716d28617ccd5df3d9d0fb2c121bb1f1eeeb8d6c/src/Keyboard.cpp

The difficulty would be to dynmically detect which one to use.

@bitboy85
Copy link
Author

Teensy is proprietary and has its own bootloader. So i guess its not possible.

The USB document above talks about 2 additional functions a "boot" device needs to have so "boot mode" could be enabled.
It is also possible that a fully compliant keyboard needs to have both descriptors/endpoints, the boot one, and the standard HID one.

@T-vK
Copy link

T-vK commented Jan 28, 2021

The Teensy bootloader being proprietary would mean that it would be extremely difficult to make changes to it, but it should be hard possible to dump the bootloader from an existing one or find someone on the Internet who has done it and flash it onto an Arduino Micro. Although the Arduino Micro might not expose all the pins you may want/need to the PCB and I suppose the bootloader could theoretically be able to somehow detect if it's running an an Adruino Micro PCB and refuse to work.

Looking a bit deeper into the document it seems like you'd also have to make changes to the interface descriptor, not just the report descriptor:
image

Unfortunately I haven't messed with USB on that level before.

@per1234 per1234 added the topic: code Related to content of the project itself label Mar 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

3 participants