Has anyone had success using the keyboard functionality of any arduino in single user mode of mac computers? I would like to inject keystrokes in single user mode, and have been unsuccessful with the atmega32u4.
-
Does it work in normal user mode? Are you using a Leonardo?– GreenonlineNov 3, 2018 at 6:21
-
Yes, it works in single use mode. It is a Micro/Leonardo clone.– necrosatoNov 4, 2018 at 18:13
-
It works in Single user mode? I thought that it was in Single user mode that you were having problems. Now I am confused– GreenonlineNov 5, 2018 at 6:36
2 Answers
OS X requires a "Boot Interface" compatible HID profile for a keyboard to work in single user mode (it has only loaded very rudimentary drivers by that point). The Arduino doesn't provide that interface, so can only work with the more advanced drivers the OS provides once booted.
You can try setting the "boot interface" flag to 1 in the interface subclass (here, I think, changing HID_SUBCLASS_NONE
to HID_SUBCLASS_BOOT_INTERFACE
) though I have no clue what the actual effect of that will be given that it's a composite device that may or may not conform to the boot interface standard.
-
Thanks for the suggestion. I tried this and saw no difference in behavior. Nov 4, 2018 at 18:16
-
-
Do you think it has to do with the board I'm using or the fact that I'm trying to do it on a mac? Nov 4, 2018 at 18:27
-
It's a combination of the two. The Mac has specific requirements (the same requirements as a PC when in the BIOS), and the Arduino's USB software doesn't meet those requirements. There may be a better board for the job that has a better USB stack, but I don't know of one off hand.– MajenkoNov 4, 2018 at 18:39
I have found the solution to my problem. The issue is that the presence of both the usb device and serial port causes issue in single user mode. For the keyboard to work properly, the serial port must be disabled. This means that reflashing the micro requires pulling the reset pin low twice quickly for the port to show up again. Here is an example of how to remove the serial port: https://github.com/gdsports/usb-metamorph/tree/master/USBSerPassThruLine