NicoHood/HID

bootkeyboard works in macos but not in firmware

Closed this issue · 1 comments

i'm trying to use a feather m0 board to automate picking the boot device in the firmware screen of a 2018 mac mini.

i started with this simple sketch:

#include "HID-Project.h"

const int pinLed = LED_BUILTIN;
const int pinButton = 2;

void setup() {
  pinMode(pinLed, OUTPUT);
  pinMode(pinButton, INPUT_PULLUP);

  // Sends a clean report to the host. This is important on any Arduino type.
  BootKeyboard.begin();
}


void loop() {
  // Light led if keyboard uses the boot protocol (normally while in bios)
  // Keep in mind that on a 16u2 and Arduino Micro HIGH and LOW for TX/RX Leds are inverted.
  if (BootKeyboard.getProtocol() == HID_BOOT_PROTOCOL)
    digitalWrite(pinLed, HIGH);
  else
    digitalWrite(pinLed, LOW);

  
    BootKeyboard.write(KEY_DOWN_ARROW);
    // Simple debounce
    delay(300);
    BootKeyboard.releaseAll();
    delay(1000);
}

when i flash the board, i can see the down arrow being pressed every second in my editor. the led is off since it's not in boot mode.

however, when i plug it in before the mac boots, the led still doesn't turn on to indicate boot mode. i have a generic brand ("insignia") keyboard that i can use to hold alt/option during boot to get to the boot device selection menu. once the boot menu appears, it seems like it supports hotplug. i can unplug/re-plug the keyboard or plug in multiple keyboards and they all appear to work. tapping the down arrow will scroll through the wifi networks list, but plugging in my board that's flashed with that sketch doesn't seem to do anything (and the boot protocol led doesn't light up).

any advice? are there boards that are known to work that i should try instead?

Sadly I dont have any solution for your issue. see duplicate: #34