Reprogramming the Pocket Keyboard

I noticed that overnight the system leaks a little bit of power (if the standby switch isn’t turned off) and i’ve been thinking of ways to reduce it. The firmware for the RP2040 has this main loop

  while (1) {
    pressed_keys = process_keyboard(pressed_scancodes);
    tud_task(); // tinyusb device task

If i add a wait to put the system to SLEEP or DORMANT state for, ~5ms maybe, and maybe only when the system is in the OFF state, i think it’ll reduce power draw. I am experienced with microcontrollers (STM32, AVR, and PIC mostly) but not so much with the RP2040 itself.

my questions are 2 fold:

  1. is there a reason why this is a terrible idea, and not worth experimenting with?
  2. If things go really sideways, is there a documented way to reprogram the keyboard if i can’t use the hyper-enter combination to turn the system on?

Thanks for any advice!

1 Like

Yes, it totally is a very good and appreciated idea to work on things like that, if you have the time. I wrote the part of the handbook for flashing the keyboard today. The handbook is not 100% done yet, but you can already use these instructions:

Beware that the main issue with bricking the keyboard is that you can’t easily turn the system on. For that, you would need a modified version of the System Controller firmware (on the RP2040 on the motherboard) which auto-powers the device the first time a charger is connected. We use this during production, see FACTORY_MODE here:

System controller flashing and unbricking instructions are here (please be very careful not to cause any shorts when working on a device powered by Lithium Ion batteries!):


I’ve been running with this patch for a couple of days – im not equipped to measure current to the keyboard, but i suspect this should help with the “standby leakage”. I’ve considered applying a similar patch to the system controller but upon inspection it seems to be needed there less.