May have made a bad mistake

I was trying to update the keyboard firmware on my Pocket, and I may have acted rashly, after resetting, I can no longer power it back on.

I had cloned the repo, ran the install-fw-dependencies script, went into the dir, ran the build.sh, seemed OK.

I put the keyboard into flash mode with “x” at the menu

the sudo picotool command gave an error like: no rp2040 found with the listed command [sudo picotool load build/sysctl.uf2 --bus 3 -f]
I then absent-mindedly ran it without the --bus 3 -f part of the command, and it seemed to flash. But now, after a hard reset, I cannot power it back on.

So, I guess I’ll have to take it apart and go through those instructions to re-flash it?

Can someone let me know what the “off” position is for the power switch? Toward the hinges, or away? I don’t get any indication either way, and don’t want to leave it on until I get back to re-flashing it.

Any hints?

Ouch!

I can’t help in any substantive way, but I can tell you my pocket is on and the standby switch appears to be away from the hinges.

1 Like

OK, I really need to clean up those scripts in git and in the handbook etc, as there are nowadays 2 universal scripts that cover all cases without messing with dependencies etc.

Anyway, you might have flashed the system controller with the keyboard firmware, as they are the same chip. It is a bit of work to recover from this state, if that happened. You’ll need to take the motherboard out, move the 2 jumpers to the other position, and connect the internal USB-C connector to another computer with a USB-C cable. The process is described here in detail: Hardware — MNT Pocket Reform Operator Handbook, 1st Edition documentation

What isn’t mentioned there: uncomment this line to set FACTORY_MODE: pocket-reform-sysctl-fw/inc/sysctl.h · main · Reform / MNT Pocket Reform · GitLab

This will make the Pocket Reform instantly turn on when power is connected. That way, you can recover from a bricked keyboard (because you don’t need it to turn the computer on). Once booted, do this to restore the keyboard:

curl -sfL mnt.re/update-pocket-keyboard | sudo bash -

If that doesn’t work, please report back, including the output of lsusb.

2 Likes

I’ll tackle this over the next day or two. I made a mistake because I kept trying things, and didn’t ask questions instead. Sorry in advance for the extra traffic. :grinning_face:

I would like to update the firmware of my system controller so an updated documentation would be very welcome! Also I have to admit that I am a little confused: New Pocket Reform will get the latest firmware I assume. So I was wondering whether there is an easy way to download the lateste binary and use that to flash the system controller. I assume that would be safer and more covenient? Quite honestly I struggle to get the firmware to build on my machine…

1 Like

From selfish reasons, I don’t think there’s a reason to apologise; as horrid as it may sound, many of us may learn from your mishap, to avoid something similar.

Having said that, I hope you can get it sorted smoothly and quickly.

1 Like

Ok, I’ve finally started.

I went through all of the steps, and I don’t see the system showing up as a USB device on my laptop. Does the system need to have the battery switch set on for this to work? I turned it off since it was going to sit for a week before I could get to it.

Should I just turn the switch on, and try again?

I’m going to download and install the firmware to build on this machine in the meantime.

Thanks.

1 Like

Tried it install, got the following errors:

murph@penguian:~/pocket/pocket-reform$ sudo ./install-fw-dependencies.sh 
+ set -- build-essential avr-libc gcc-avr gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib libusb-1.0-0-dev cmake python3 gcab
+ '[' '' = true ']'
+ set -- build-essential avr-libc gcc-avr gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib libusb-1.0-0-dev cmake python3 gcab tio picotool
+ set -- apt-get --update --no-install-recommends -y install build-essential avr-libc gcc-avr gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib libusb-1.0-0-dev cmake python3 gcab tio picotool
+ '[' 0 '!=' 0 ']'
+ echo 'Running apt-get' --update --no-install-recommends -y install build-essential avr-libc gcc-avr gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib libusb-1.0-0-dev cmake python3 gcab tio picotool
Running apt-get --update --no-install-recommends -y install build-essential avr-libc gcc-avr gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib libusb-1.0-0-dev cmake python3 gcab tio picotool
+ apt-get --update --no-install-recommends -y install build-essential avr-libc gcc-avr gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib libusb-1.0-0-dev cmake python3 gcab tio picotool
E: Command line option --update is not understood in combination with the other options

Sorry for the extra postings, last time I improvised, I bricked it, so I’m going a bit slower this time.

1 Like

So, my first question is, does it require power to do the reflash? Or does the USB connection supply the power? As of right now, the board does not show up at all on my Debian laptop to do the flashing.

I have more things to check. USB drives mount OK, but for some reason, I can’t seem to mount some other devices. Like a phone, which when connected, seems to not show up.

Going to boot into fedora and see if it’s some kind of fussy hardware.

I don’t see it in in lsusb. The same 8 devices are listed before and after connecting via usb on the internal port.

The x86 laptop is running debian 12.11

I tried re-cloning and starting over.

Same error, listed alone for clarity here:

E: Command line option --update is not understood in combination with the other options

apt uses apt update, not apt --update; removing that -- from the script might just fix it.

1 Like

I’m wondering how that can happen, I just cloned it, following the instructions in the manual.

I just looked at the repository, and I actually think it’s just an error in that script, in the current head revision. I’m pretty confident that you didn’t do anything wrong, and you should just change --update to update.

I’m not sure why that script is written in the way that it is, it looks a little strange to my eyes, but I’m sure there was a reason. It seems to do something reasonable, at any rate.

I tried to change it as you suggested, but it didn’t seem to work. I’ll try re-cloning it, and try again later.

re-cloning will just give you the same content again and not fix your problem. To obtain the latest version, run “git pull” inside the git directory.

No, changing --update to update will turn the commend into apt-get update install ... which is also wrong.

The --update option is a fairly recent addition to apt and the script does not check which version of apt you are using. It might just be that your apt is too old.

I agree that either the script should check whether your apt is new enough or it should not use apt options that require a recent-ish apt. I filed this MR to fix this:

Until this is fixed: what is your apt version? You can run apt-get --version to find out. The following command will also give you the answer:

dpkg-query --showformat '${Version}\n' --show apt

You need apt 2.7.0 or newer. Thanks!

1 Like

Oops, I should have looked more closely, sorry! (I don’t have my pocket reform yet, so I haven’t tried any of this.)

Thanks for the response. I am at 2.6.1, so it looks like that’s the problem. I’m going to update the system to testing. (no data to speak of, so no risk there)

I was hoping to bump this up. I highly suspect that the battery switch must be ON for this to work, but I don’t want to make another mistake, and actually damage the hardware. Can someone confirm for me?

Success! Software updated. Now the power switch question. @josch ?

1 Like