Flashing the keyboard firmware

I just failed to flash the keyboard firmware for my pocket :grimacing:Well it all succeeded (after putting the keyboard in programming mode), but I think moving the enter key down one row in matrix.h means I can’t use Hyper+Enter in new or old position to boot. Is that expected? The sources made me think it should be fine. Now Hyper+anykey gives me “Press Hyper + Enter for menu. Hold to power up”… have I any options other than disassembly to put the controller in factory mode now?

ah… I just noticed the flash.sh script in the firmware repo directory, and that uses picotool to reboot the rp2040. I ran the picotool load command from the manual, waited a minute or two after the progress bar had completed, and then toggled the reset switch. Maybe that left it in an inconsistent state?

I’m on vacation the next couple of weeks, but unless I get better advice before then I plan to manually flash the system rp2040 with a factory mode setting when I get back. I’m very nervous about disassembling my new favorite toy so early on though!

I believe I can cross compile the sysctl from my intel thinkpad and flash the disassembled pocket by connecting to the internal usb and carefully following instructions on setting dip switches. Then I should be able to power up with just the charger, and trying programming the keyboard again with an external usb keyboard attached.

Once I’ve figured out what I did wrong, I’ll put together a prototype keymap editor gui with Lua!

2 Likes

The plan worked, and the pocket now boots in factory mode shortly after connecting power. Also, now that I have a running terminal after booting I can see that my remapped keyboard is working perfectly too!

But something is not right because the OLED display does not come on with the remapped keyboard. When everything is powered off, and there is some charge in the battery I can provoke the press HYPER + ENTER for menu and hold for boot message on the OLED, but it is otherwise off, and does not respond at all when fully booted from Factory Mode, so I can’t put it into programming mode with HYPER+x (using the original or remapped x key location) nor bring up the OLED menu with HYPER+ENTER (using original or remapped ENTER key location).

@minute Is there another way to reflash the default keyboard fw?

Well dang. I found the error in my remapping… I moved ENTER down one row in the normal matrix, and replaced the ENTER key in the HYPER matrix without also adding an ENTER one row down. So there’s no key-chord for HYPER+ENTER in the current layout.

But it’s good that I discovered this now, so that once I’ve fixed it, I’ll be sure to have my keymap editor prevent you from making a HYPER layer with no ENTER key in it!

2 Likes

IIRC you can double-tap the keyboard’s reset button to get it to flashing mode. Might take a few times to get it right.

@minute thanks for the tip… but no luck . I see a reset button between the number keys and the OLED board after removing the keyboard top cover? I see there’s also a prog button there, but various double and triple taps with a spudger from fast to fairly slow seem to only restart the OLED module. Or is there an additional reset button somewhere else for the keyboard?

OK, that’s the right one. If that doesn’t work try holding down prog while you press reset.

On a Pi Pico holding down prog while connecting power goes into mass storage (programming?) mode. If connecting power is like reset than this should work, as long as you release reset before prog :slight_smile:

Thanks @minute and @pff! With well spaced out presses, it worked:

  1. press and hold reset for a second
  2. with reset still held down, press and hold prog for a second
  3. release reset
  4. a second or so later release prog
  5. with an external keyboard, run the flash.sh script after recompiling the fw with an ENTER key on the HYPER layer this time

And everything is working properly again :laughing:

4 Likes