I’m rebuilding my firmware to try to fix a keyboard issue I’ve been having. I followed DHowett’s guide for building. I’m using Windows Subsystem for Linux. It seems to have built a correctly-sized binary. I followed the warning to use GCC 10. I’ve got ectool booting properly and showing version as well, but I chickened out before reflashing because I really don’t want to brick my laptop.
Before doing the reflash, what tools should I get or other preparation can I do to ensure I’ll be able to revive my laptop if something goes wrong?
For background, I have dabbled with a Raspberry Pi Pico and can solder stuff badly, but don’t have any real electronics experience.
In case anyone is curious what the issue is: on any computer I’ve used in my whole life except this Framework laptop, the keyboard repeat behavior is different.
press and hold A
press and hold B, while also still holding down A
expected: B keeps repeating
actual: no keystrokes repeat
I found a place to patch it in the keyboard code in the firmware, so that’s what I want to try now.
Hey there! Sorry I let this thread sit for a while.
Honestly, I can’t recommend any specific recovery tools that would help if you really do brick the thing (i.e. get it into a state where the EC isn’t booting.) I believe you would be able to debug it via the JECDB header (0.5mm FPC (?); pinout described in Framework’s upstream EC repository), but I haven’t tried this myself.
I chose to jump in with both feet and absolutely no recovery plan . It is probably not for everyone.
Worst case, I think that you should be able to attach to the SPI flash on the backside of the mainboard with a chip clip (for example, this Pomona SOIC-8 clip) and hold the EC in reset while you reflash it over SPI. I should probably try this out before officially recommending it to people.
Funny enough, that key repeat behavior is exactly one of the reasons that I got into doing my own EC mods! I thought I was a crazy person for noticing it!
Thank you so much for the reply. Directly interfacing with the SPI flash chip sounds a bit worrisome to me. I’ve never done that before. I see the JECDB seems to support SWD, so I’d like to experiment with connecting my Raspberry Pi as a Picoprobe.
If I can get that connected, do you think it would be possible to fix a broken EC by loading in a pristine backup into memory using a series of memory write commands from the debugger? That would depend on being able to get the debugger connected at a point where I can overwrite the firmware image in memory before it tries to execute it.
Or I if flash is mapped as a range of memory addresses, would I be able to use memory edit commands to write the pristine backup directly to flash?
A chip clip like DHowett mentioned is what people normally use for recovering chips from bad flashes. They aren’t hard to use, presuming there isn’t anything physically blocking you from attaching the clip. I’ve used an ultra-cheap aliexpress SOIC-8 clip a few times.
OK, thank you for that guidance. I found a bit more about the procedure from pages about unbricking a Chromebook. I assume since the Framework EC is a fork of the Chrome OS EC, this ought to be a similar procedure. It looks like that flash chip programmer can detect the chip type so I’ll know I’m about to make a mistake. I’ve ordered the programmer parts and now need to find the chip on the mainboard.
Thanks, I’ll check out the RPi method too. One thing I’m curious about is the mention of “VPD” (vital product data). When I extract a pristine copy of my firmware, theoretically it will have this included. When I flash a new firmware, is it going to have blank data for my serial number, MAC addresses, and so on? Do I need to somehow merge the pristine copy’s VPD with the new firmware? Or when I flash the firmware image will it overwrite only the fixed part and leave my per-device information alone? I guess that’s a question for @DHowett about ectool.
The only product data that has been observed is a list of serial numbers for the components that the product shipped with (which the EC firmware neither reads nor writes) and a region containing the date of first boot (which the AP firmware writes directly to EC flash and is likewise not read by the EC firmware).
ECTool.efi’s reflash subcommand (which is not the same as upstream ChromeOS’s ectool and its flashwrite subcommand) preserves the VPD region.
Well, my WSON-8 probe arrived today, and I was able to use the CH341a programmer on a Windows PC with AsProgrammer and the right CH341a drivers to read the contents of the chip.
Unfortunately, my probe arrived with a pin broken, so I had to hold a wire touching one of the pins, so my hand is tired, and I couldn’t verify the downloaded image against the flash chip again.
I have two questions, hoping people can help me with:
why is the flash so big? it seems to be 32 MB of space available, of which the EC firmware is only 512 KB
if I need to restore from an EC backup that I create using ECTool.efi, what offset should I write it to?
From some light spelunking, it looks like the flash chip’s storage at offset 0x1000 and length 0x80000 are identical to the ECTool.efi-created backup, so maybe that’s the answer to #2. I would much rather write just that portion in case my hands shake and I lose the connection.
Where did you find information about the expected size of the flash chip? Is there a parts list or something for what I should find in my 12th gen laptop? If it should only be 1 MB, then it means I might not have found the right chip on the board… but it’s a strange coincidence to find an exact copy of the firmware in that chip. What is it for?
Also, the EC flash configuration on the Framework EC github page (sorry, can’t link. it got flagged as spam) says:
OK, looking at the schematic, I see there are two SPI ROMs, a 1 MB one connected to the EC and a 32 MB one connected to CPU. Looks like I found the latter. I have a sneaking suspicion the EC and the 1 MB flash are under the fan or something. Really hoping they’re not on the bottom side of the mainboard… Does anyone know?
After hunting around on the top side of the mainboard a bunch, I finally decided to pull it out and look at the underside. There are actually three of the same model flash chip on the bottom: W25Q80DVIG. Looks like this is a 1 MB flash part, so that matches the schematic and earlier replies.
This chip is SOIC-8 but they’re all mounted almost flush with the board, so my SOIC-8 clip doesn’t fit. I’ll need to get a probe or something instead. There’s one quite close to the EC MCU, so that’s the one I’ll try first.
When I eventually write up something about this whole deal, I’ll include all the pictures I took, because there’s a real shortage of pictures of the bottom side of the mainboard.