1

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? – Greenonline Nov 3 '18 at 6:21
  • Yes, it works in single use mode. It is a Micro/Leonardo clone. – necrosato Nov 4 '18 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 – Greenonline Nov 5 '18 at 6:36
2

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. – necrosato Nov 4 '18 at 18:16
  • Ah well - then the answer is probably "no"... – Majenko Nov 4 '18 at 18:22
  • 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? – necrosato Nov 4 '18 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. – Majenko Nov 4 '18 at 18:39
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.