-
-
Notifications
You must be signed in to change notification settings - Fork 409
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
Keyboard not recognized at boot / BIOS #34
Comments
Hey Nico, Have a look at Appendix E of the hid1_11 pdf you've linked to, there's an example:
|
Sure, if I ever have time to do that. I didnt even had time to review your PR. I just add issues if things like that come to my mind. I also did not translate my german notes I wrote someone as email. As always: If you have a fix, open a PR. |
Haha, stupid 24 hour days ;-) |
I have to admit that I am working on the IRLremote instead :D totally worth it. Fixes will come, sooner or later. |
The feature would be very great! |
Does the teensy work at boot? has anyone tested this? I dont know what is required for a boot keyboard. If the teensy works at boot we could try to search for the difference in the code and fix it. The teensy keyboard is currently in the dev repo, but I dont think this works like this. I think the hid interface descriptor will be different then. |
In the Teensy USB Keyboard example it's clearly said: I don't have Teensy to check it though |
I do not think that this will work with our current setup. But it should be possible to implement this. It requires a single HID Interface with just a keyboard and with no report ID. This differs from the current implementation. It would require a new endpoint to be used and some API changes. Those changes are similar to what would be needed for raw HID + The interface descriptor mentioned in the link above. http://www.avrfreaks.net/forum/avr-all-firmware-usb-and-pc-bootbios |
Got it working under my Bios. Feel free to test it. You need to install the latest dev version of HID Project and the patched IDE with .alinkage. See the wiki on installing instructions. Then you need to outcomment this line in HID-Project.h to enable the boot keyboard API. Working for improved keyboard and Teensy Keyboard as well. Booting took a bit longer than normal for me. The keyboard will not work under the OS currently, only via BIOS. With further work this can also be accomplished. Fix commit: |
@bam80 @RingoM Now enabled by default! There were a few bugs that now should be removed. Booting is fast now and it automatically switched between boot protocol and normal protocol. You can deactivate this function now, if it causes problems. This was only tested under linux with a newer bios(UEFI). It could be possible that it does not work with older BIOS, because I did not implement every required function. Thats enough at least for my bios. If it doesnt work for you, let me know and I will patch it. Unless it works, I wont add more "useless" code.
|
Thank you @NicoHood, it's awesome! |
@NicoHood please how do I add the boot USB protocol to the arduino ide from dev 2.4 I cannot find any.zip files and I'm kind of new to this thank you for your time and effort on this matter |
It is enabled by default. Just install the library as described in the wiki and use the keyboard API. (maybe in further versions it will be disabled again, I need to have a look at this once again. RawHID caused this some problems). |
@NicoHood thank you for the reply I'm not sure where to find the library as I can't see a folder in 2.4 code do I download and install 2.2 then add files I have read the wiki and do not u derstand what to do sorry to pester you |
https://github.com/NicoHood/HID/tree/dev_2_4 And then read the wiki on how to install this zip file. the wiki will link to the arduino page. basically you open the ide, search for libraries and select install via zip file. Or you put the file manually in your arduino/libraries folder. |
Thank you for your help I've now Dow loaded the .zip and will install when
|
Just include HID-Project.h and you can use the Keyboard API. Try the examples. This is not a support forum, sorry. If you have further technical questions/bugs please write it here. Otherwise contact me via PGP mail: www.nicohood.de for instructions. |
Ok I will try this thank you very much for the help I will email you if I
|
Current dev version requires this PR: A real bootkeyboard is now implemented. Multireport Keyboard is still supported, but not as boot compatible. I wanted to a) keep it simple, and b) to the official specs. Everything else would just work half of the time. Please test the BootKeyboard sketch. For me the Arduino detects the boot mode (led lights) but not when starting back the OS. Not sure if this is a feature/ intended of linux or just a lock of the HID implementation. Because the idle mode and getreport and getprotocol is not supported yet which normally is essential to work as bios. However it works more or less. No further testing has been done. I also dont need this feature myself so I dont really care much more if noone is willing to test. |
Mouse needs further testing. At the moment it leaves out the wheel data in bios mode. However it does not recognize when it comes back to report mode (for keyboard at least). This means after a reboot the mouse (wheel) might not work at all. |
Hi Nico, you said:
What did you mean here? |
This was for the implementation before. There is a variable called "protocol" in the BootKeyboard class. This indicated if the USB Keyboard is in bios mode or not. However it does currently not reset back to normal mode (currently). This is no problem now, because the report is always the same anyways. Before where i mashed up all other devices as well (consumer etc inside a multi report) this would have caused problems. I think I need to reset the variable on reenumeration. Then people can detect when they are in bios mode or even if a pc reboots or so. However for the functionality NOW it doesnt matter anymore. Clearer? Sorry if thats all mashed up. When the time is ready i try to make the wiki as clear as i can. |
Thank you but it isn't too clearer actually. |
Keyboard has no bios compatiblity. BootKeyboard has. Bootkeyboard detects when the usb host changes to bios/boot mode. However there is no actual difference in sending the reports to the host, so that information is useless somehow. However the proper implementation would be to know the state (bios or not) because the idea behind this is to implement a whole different device after bios finished (such as an nkro keyboard). The current sketch works in both modes, it always acts the same. It detects if the host switches to bios mode but not back (at last for linux, linux seems to not send a signal). The detection can be made visible via the led. But as said it doesnt switch back. But its just a variable, the keyboard will continue to work anyways. Maybe you should look at the bootkeyboard source if its still unclear. Hm... This changes the protocol variable (which is almost useless but should indicate the device to change to pure bios mode if it uses other stuff in non bios mode). However this only works from report -> bios mode and not back (yet). HID/src/SingleReport/BootKeyboard.cpp Line 126 in 64b89df
|
Ah, this is what I've asked before: if I could use BootKeyboard class all the way for now. |
Renewed the whole Keyboard API. I havent tested the delta between the new version but it should possibly be smaller. In any case its more clear now and should work better. The main reason why I did this is that you cannot press all keys via write() before (like volume up/down). Instead of inputting a 2 byte value I just improved it the correct way. AddKeycode etc is now just renamed, the option is still there. Feedback appreciated. More Key definitions will follow. Consumer Keys and System key support will follow (yes for keyboard, in the same report). But only for linux, because windows sucks. Meaning you can integrate 3 device functions into a single device =) This is especially useful for u2 Uno devices combined with a raspi for example. But it also gives less API overhead for new devices and their descriptors. |
Closing this, as it is implemented now. If it doesnt work, let me know. |
Can you please try to: plug in the arduino when the bios is loading. Like a normal boot, not a reboot. And then also test a reboot. Cause if the usb state is changing a lot (reboots) the arduino could possibly get confused and fail. But actually I have no idea whats going on. I'd have to debug this and get such a PC/bios myself. And to be honest I currently have not the time to debug it. You may want to contact me on tox and kindly ask if i have time to help you in chat. |
Hi, |
I dont think that this will change much. You can set it here: The definition is in the pluggable hid core (of the ide) i think. To really debug this we need to a) read the usb specs about boot compatible devices again (not all required functions are implemented). And b) we need to add debug output to see what is going on. What does the host request etc (with serial1). This is complex. |
Well it does force it into boot mode (LED on) when connected to a running computer. The same computer in BIOS does not seem to be enumerating it as the LED fails to light. |
you can add a blink without delay inside the loop for another led/pin. Also the bios could have problems with the 500ma spec. You might want to change that (somewhere in the arduino usb core, usbdesc.h i think). As I said, contact me in tox for faster support (tomorrow again) |
Added a blink code in and in BIOS the blinking continues so the sketch isn't crashing. The TX light still flashes once only after shorting and that's all. |
@NicoHood : I am not sure still you are in track of this issue. Hopefully you are. I am using learnado with HID-Project 2.4.4. I don't have any issues with either BIOS or OS. void setup() { void loop() { BootKeyboard.write(KeyboardKeycode(KEY_F2)); |
So you are saying that you can use left/right inside the bios to switch pages, but are unable to enter setup? Have you verified the f2 key works properly when inside the os? I'd try to press and release the key with some delay in between each press. |
Thanks for looking into this.
Yes. That is correct. (f3, F4 every keys are working inside BIOS)
Yes. F2 is working. I have verified with a KB tester application. Today I did some more experiment after I paused in the pre-boot screen. (Attached the screen). void loop() { Thanks. |
Does the keyboard work after you entered setup? |
I hope you mean setup(). - Yes F2 works in setup().
My problem is ONLY with the pre-boot screen. I tried with a another arduino -learnado. Still no hope :( |
I mean once it reaches BIOS it returns the protocol as HID_BOOT_PROTOCOL. But in the early/pre boot it is recognizing arduino as normal (HID_REPORT_PROTOCOL). |
no i mean if you tried the arduino in the bios setup, after you pressed f2. Check if the arrow keys work etc. If not, I dont know whats the problem of your bios. I've tested the fujitsu laptop bios which is based on infineon. Which bios vendor is your bios from? American megatrends? phoenix? infineon? how old is your pc? are you booting with csm enabled or disabled? I currently have no hardware to even retest on my own system, but it must be something in between bios and keyboard. |
Sounds a lot like the issue I was having, I tried hours and hours to get it to work and couldn't. In the end I tried a teensy and it's built in keyboard function and it worked perfectly. I wish I had of tried it sooner! |
Some old version - phoenix. I tried with few other machines too with infineon. Still i could see the issue. I have another observation, hope it will narrow down to the possible root-cause. a) If I boot my machine from a complete shutdown - F2 or any other keys are working in the PRE-BOOT screen. b) But a reboot from OS/BIOS - The F2/any other keys are not working in PRE-BOOT screen. So I believe the problem is with the reboot procedure. Appreciate if you can give me some clues or the area in the library I can have a try. Thanks |
Another observation in LEDs Booting from shutdown - Rx LED blinks twice Thanks |
Is it a cold or warm reboot? A cold reboot turns off usb power for a short time. |
Hallo NicoHood! I have pretty much the same problem, although it doesn't matter if I reboot cold/warm or from a complete shutdown (Stromlos). I have a couple of HP-Bios to set up (130 to be exact). I tried it with your example code, since I just wanted to test possibilities... KEY_ENTER/_F10/_DOWN_ARROW are all not responding. TX blinks once when Pin 2 is shorted. Doesn't blink again when 2 is kept shorted. PinLED never turns on. Behavior in MacOS/Windows as programmed/expected. Any Ideas?
I never tried forcing it in HID_BOOT_PROTOCOL... |
As an alternative you could try LUFA. I built an API around that, please checkout the example here: The code is provided "as is" I did not create any docs yet. Feel free to check it out, but you have to figure out how everything is done yourself. |
hi BenediktRPI ! Reading about your post to use an arduino to set the Bios. Which arduino do you use ? Best regards. Wilbo |
My attempt at fixing bootkeyboard for SAMD boards. https://github.com/gdsports/HID/tree/bootkeyboard/examples/Keyboard/BootKeyboard |
To everyone who still has problems with keyboard in bios: |
You can also try this: |
The keyboard has to be a special boot keyboard with a standard descriptor. I heard it is possible with Teensy. More information can be found in the official USB docs.
The text was updated successfully, but these errors were encountered: