I decided to try remapping my PROG key to the power key. (I’m on a mac, and the power key is part of the “lock screen” key chord, so it needed to go somewhere, and prog seemed the natural place to put it.) On macs, if you hold down the power key on an external keyboard, it gives you an option to shut down the machine (in a dialog box) which you may ignore (by pressing ‘cancel’), ie, it’s not like the PROG key now has the property of shutting down my machine.
Nevertheless, I am now having trouble reprogramming the keyboard via the arduino IDE. In particular, when I try to send a sketch to the keyboard while holding down PROG (after pressing ‘cancel’ on the shutdown dialog), the sketch simply hangs.
I suspect that this is due to the change in the PROG key (evidence: if I don’t hold down the prog key, then arduino complains that the programmer is not responding; if I do hold down the prog key and clear the shutdown dialog, then arduino simply hangs in the “Uploading…” state eternally), though that might be a red herring; there could be some other way in which I managed to misconfigure arduino simultaneously. But, assuming the problem is a PROG key being mapped to POWER on a mac, how can I get the keyboard back into a programmable state?
One way would be to unplug your keyboard, hold the PROG key, and plug it in while still holding it. It will enter the programmable mode then, without sending the Power key to the host. You should be able to re-flash then, without having to hold the key again.
I had an issue with my keyboard getting ‘stuck’, and I had to hold the PROG key and plug the board in after starting to uploading the code, but before it finished trying to upload. It would not work if I held down the PROG key and plugged it in before I started the upload. The PROG light would turn red, and initially another COM4 port would show up in the Tools menu, but then it would disappear after I selected it. COM1 was the only other available port, but it was not working either. Once I plugged in the cable while holding the PROG key after having started the upload, I was able to get my keyboard ‘unstuck’ and port “COM5 (Keyboardio Model 01)” showed up again and stayed connected.
The timing can be tricky. I do wish it would stay in the bootloader for as long as I held the prog key, rather than timing out and starting the flashed firmware.
It’s not something that will be easy to update on an existing keyboard without an external programmer, but we can at least improve things going forward.
Done. Out of curiosity, what extra hardware is needed to update the bootloader?
(I’ve been experimenting a lot, and flashed quite a few versions of bad firmware that make things difficult if I get the timing wrong on plugging in and hitting enter on another keyboard)