thanks for letting us know! it’s fixed now. ![]()
@minute, in attempt to add third layer to keyboard firmware, I tried to use this small screen to print debug info, and it looks like it was bad idea to use screen in the keyboard loop.
Now what I have is the keyboard stuck in the loop and is not responsive. I tried to reset using the unbricking guide, but after step 6 (connecting SYSUSB to my other computer, the device does not announce itself, not as storage device, not even as some usb device in dmesg log).
Is there anything else I can do in order to reflash keyboard firmware?
Hi, the unbricking guide is the way to go. The sysctl to USB interface must work. Maybe there’s some little detail that went wrong in the process? Can you do it again and if you get stuck, show some detail pics of how you set it up and what your last steps were?
So what I did was something like this (the actual change on the device and I did not yet comitted yet)
diff --git i/pocket-reform-keyboard-fw/pocket-hid/src/main.c w/pocket-reform-keyboard-fw/pocket-hid/src/main.c
index ba2da22..9ac0fac 100644
--- i/pocket-reform-keyboard-fw/pocket-hid/src/main.c
+++ w/pocket-reform-keyboard-fw/pocket-hid/src/main.c
@@ -417,6 +417,12 @@ static int process_keyboard(uint8_t* resulting_scancodes) {
} else if (keycode == KEY_COMPOSE) {
hyper_key = 1;
active_matrix = matrix_fn;
+ {
+ char repinfo[64];
+ snprintf(repinfo, sizeof(repinfo)-1, "hyper -> 1");
+ gfx_poke_str(0, 0, repinfo);
+ gfx_flush();
+ }
} else {
if (menu_state == MENU_STATE_ACTIVE) {
// not holding the same key?
@@ -442,6 +448,12 @@ static int process_keyboard(uint8_t* resulting_scancodes) {
// key not pressed
if (keycode == KEY_COMPOSE) {
hyper_key = 0;
+ {
+ char repinfo[64];
+ snprintf(repinfo, sizeof(repinfo)-1, "hyper -> 0");
+ gfx_poke_str(0, 0, repinfo);
+ gfx_flush();
+ }
active_matrix = matrix;
hyper_enter_long_press_start_ms = 0;
} else if (keycode == KEY_ENTER) {
I wonder if using LED screen in this tight loop gives the time for the device to switch to BOOTSEL.
Another thing, as far as I remember the keyboard and system board are presented as separate devices. Does the unbrick guide puts both of them into BOOTSEL mode or only system board alone?
I am not sure if this will help, but to clarify as I understand it,
The first part of the guide, all the way to step 12, is to update the sysctl firmware to be able to turn on the computer without the keyboard. This part of the process does not depend on the keyboard working. But this part is necessary because you need the computer on to be able to flash the keyboard firmware.
The second part of the process, step 12 onwards should show you how to flash a good firmware to the keyboard once your computer is on (using an external keyboard connected to the pocket)
If you are stuck in step 6, I don’t think that is because of your keyboard.
Right, this is what I though too. And it is strange that when I cannect SYSUSB to my other laptop, nothing shows up in dmesg. The cable is good, and at least I can use it to connect the phone, and other devices.
UPDATE. Just as I posted this message, I decided to try different cable :). And it works.
UPDATE2. But to get past step 12, I need working keyboard, which is still in this weird loop.
I wonder if keyboard could be flashed using SYSUSB from the second computer?
$ sudo reform-mcu-tool list
Target pocket-sysctl-1.0 "MNT Pocket Reform System Controller 1.0" ID 1209:6d07 Serial# DE63544193563E34 USB bus
5 address 2 Version gb1df2fe
For some reason, it does not show the keboard, so I cannot proceed with step 12.
Did you connect an external keyboard?
It would be helpful if you could be more specific about the first step of the guide that doesn’t work for you. For example, did you get all the way through Step 12 and got an error on Step 13? If you got an error you can post a screenshot, etc.
Yes, I booted the device and connected external keyboard.
Now I am trying to flash vanilla keyboard firmware with mnt.re/update-pocket-keyboard, but the script cannot do it as reform-mcu-tool does not see the keyboard device.
The script says
Error: MNT Pocket Reform Input device not found or more than one found.
I don’t know if this is necessary, but I believe you can manually put the keyboard in programming mode. See the steps outlined in other posts in this thread. You should press both reset and prog and release reset before prog (these are on the keyboard PCB).
I suggest you try to put the keyboard in programming mode with the manual switches and then run the script from the guide again. I am now confused about reform-mcu-tool vs pico-tool but the script should use the right one.
Right this is what I was looking for. Now everything is resolved.
Recap.
- I messed with keyboard firmware introducing some bad code in it
- The keyboard has stuck and became unresponsive
- I followed the unbricking guide
- Because of strange USB-C cable, the SYSUSB connected main board was not visible
- With different USB-C cable, I managed to flash recovery system firmware to boot automatically on PD cable being inserted
- Now, I have to put keyboard into BOOTSEL mode with removed keyboard cover and PROG/RESET buttons dance
- …
- Profit
Thats great!
@minute @holo_memory perhaps the de-bricking guide could mention the option to put the keyboard in programming mode manually if the script to re-flash the firmware can’t find it? I am not sure if there is a specific combination of issues here that lead to this being necessary, but at least in this case it solved the issue.
This is now in HACKING.md in the keyboard firmware repository. ![]()