3

I am trying to turn Raspberry Pi Zero W as a "boot compatible" keyboard (USB gadget). I've followed this tutorial to make it work in OS, i.e. when plugged into a Mac computer that has been powered on and logged into a user, I can send keystrokes via Raspberry Pi to the Mac by running scripts writing bytes to device file (/dev/hidg0). The tutorial makes use of two modules: dwc2 and libcomposite.

However, I need the Pi to work as a keyboard in Mac's EFI (BIOS). Specifically I want to send Command+R keystroke as the Mac is booting up to enter the recovery mode.

Looking at the official document from the USB org, boot keyboards require support for SET_PROTOCOL and GET_PROTOCOL requests from the host (Appendix B.1 and F.3). I did modify the report descriptor as shown in Appendix B.1.

According to line 496 to 606 in this class in Raspberry Pi Linux source code, it seems like the module supports SET_PROTOCOL and GET_PROTOCOL requests.

However, Pi as keyboard gadget does not work in EFI; only in OS.

Does libcomposite not include f_hid.c class? If not, does anyone have any insight into how to implement a boot keyboard gadget? I feel like I am missing something.

Thank you very much in advance!

Fyi, this is my report descriptor.

1
  • I'm not a moderator, but if I were, I'd move your question to the Raspberry Pi Stackexchange: raspberrypi.stackexchange.com it's quite an interesting question.
    – leeand00
    Jan 10, 2020 at 14:57

0

You must log in to answer this question.

Browse other questions tagged .