bios-external-programmer
FreeRuns bundled scriptsNot checkedRead or write a laptop's SPI flash in-circuit with flashrom, using an ESP32-S3 dev board as serprog programmer or a Pico/CH341A. Use when the OS cannot write…
by laurigates★ 61 GitHub starsAbout this skill
BIOS External Programmer (in-circuit SPI flash)
When the chipset write-protects a flash region from the OS
(bios-plugin:bios-flash-protection-audit shows WP=1 with FLOCKDN=1), the
only way to write it is a programmer clipped onto the chip. flashrom's
serprog protocol lets a cheap microcontroller board do that job.
Status: the ESP32-S3 firmware from Step 1 compiles and has been checked by reading its source. No in-circuit read or write with it has been verified yet. The 16 MB write reported upstream was a 1.8 V chip at 250 kHz through a level shifter. Verify a read against a known backup before any write.
When to Use This Skill
| Use this skill when... | Use something else when... |
|---|---|
| The OS cannot write the flash region you need to change | The OS can write it: flashrom -p internal |
| Recovering a machine whose firmware no longer boots | Only reading is needed and the OS can read: bios-plugin:bios-flash-protection-audit |
Choosing a programmer
| Board | Works? | Notes |
|---|---|---|
| ESP32-S3 (Seeed XIAO ESP32-S3, Waveshare ESP32-S3-Zero, …) | Yes, with thisiseth/esp32-serprog | 3.3 V logic, native USB Serial/JTAG (no baud limit). Needs ESP-IDF ≥ 6.0 and a pin edit |
| Raspberry Pi Pico (RP2040) | Yes, with pico-serprog (firmware and steps in the libreboot SPI guide) | The best-trodden route; libreboot removed RP2350 support, so buy an RP2040 |
| Raspberry Pi (40-pin) | Yes, flashrom linux_spi via /dev/spidev0.0 |
3.3 V native |
| CH341A | Yes, flashrom ch341a_spi |
Some boards put 5 V on the data lines; use a 3.3 V-modified one |
| Arduino Nano/Uno | Possible (frser-duino) |
5 V logic needs dividers; its 3.3 V pin cannot power an in-circuit chip |
| CP2102, CH340 (USB-UART) | No | UART only; flashrom cannot drive SPI through them |
flashrom's serprog programmer is in Homebrew's flashrom (macOS and Linux)
and in distro packages, so the host side needs no source build.
Step 1: Build the ESP32-S3 firmware
bash "${CLAUDE_SKILL_DIR}/scripts/build-xiao-serprog.sh" ./esp32-serprog-build
The script:
- Clones upstream at a pinned commit (
0ca3c7e, 2026-07-23). - Applies scripts/xiao-esp32s3-pins.patch: SCK D8/GPIO7, MISO D9/GPIO8, MOSI D10/GPIO9, CS D1/GPIO2. Upstream's default S3 pins (GPIO 2/40/41/42) are not all on XIAO pads.
- Builds with ESP-IDF ≥ 6.0 (
IDF_PATH, default~/esp/esp-idf). - Fails if the transport is not USB Serial/JTAG or Wi-Fi is on.
It prints the binaries' hashes and the flash offsets. On a XIAO Sense, remove the camera/SD expansion board, whose SD slot shares GPIO7/8/9.
Flash the board (hold BOOT while plugging in if it does not enumerate):
cd ./esp32-serprog-build/xiao-serprog-out && python -m esptool --chip esp32s3 -p <port> -b 460800 --before default-reset --after hard-reset write-flash --flash-mode dio --flash-size 2MB --flash-freq 80m 0x0 bootloader.bin 0x8000 partition-table.bin 0x10000 main.bin
ESP-IDF v6 ships esptool v5 (write-flash, not write_flash). The port is
/dev/cu.usbmodem* on macOS and /dev/ttyACM* on Linux.
Step 2: Wire it (SOP-8 25-series flash)
| Chip pin | Signal | XIAO pin | Note |
|---|---|---|---|
| 1 | CS# | D1 (GPIO2) | 47 Ω in series |
| 2 | SO / MISO | D9 (GPIO8) | 47 Ω in series |
| 3 | WP# | 3V3 | through 10 kΩ |
| 4 | GND | GND | |
| 5 | SI / MOSI | D10 (GPIO9) | 47 Ω in series |
| 6 | SCLK | D8 (GPIO7) | 47 Ω in series |
| 7 | HOLD# / RESET# | 3V3 | through 10 kΩ |
| 8 | VCC | 3V3 | one supply only |
Pin 1 is next to the dot on the package. A WSON-8 chip has the same pinout but no legs, so a SOIC clip will not grip; use a pogo-pin probe or solder wires.
Safety order:
- Disconnect the laptop's battery connector and remove the charger before clipping on.
- The firmware drives the SPI pins as soon as it has power and never releases
them (no
S_PIN_STATE). Unplug the clip before powering the laptop. - Use one power source on VCC. If the chip ID reads as all 00 or FF, or reads differ, the laptop's 3.3 V rail is drawing current through VCC. Use a separate current-limited 3.3 V supply with a common ground.
Step 3: Read, verify, and only then write
flashrom -p serprog:dev=<port>,spispeed=2M --flash-name
flashrom -p serprog:dev=<port>,spispeed=2M -r ext-1.bin
flashrom -p serprog:dev=<port>,spispeed=2M -r ext-2.bin
sha256sum ext-1.bin ext-2.bin <backup-from-the-os>.bin
- Several flashrom chip definitions can share one JEDEC ID. If flashrom asks,
pick with
-c "<name>"from its list, matching the part number printed on the chip. - The two external reads must match each other. Compare them with the OS-side backup; differences limited to the UEFI variable store or ME data are expected if the machine booted in between.
- Raise
spispeed(4M, 8M) only after reads mat
Install bios-external-programmer in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
Bash(bash ${CLAUDE_SKILL_DIR}/scripts/build-xiao-serprog.sh *)Bash(flashrom --version)Bash(ls /dev/cu.usbmodem*)Bash(ls /dev/ttyACM*)Bash(sha256sum *)Bash(shasum -a 256 *)Bash(cmp *)ReadGrepGlobAskUserQuestionBundled files
FAQ
What does the bios-external-programmer skill do?
Read or write a laptop's SPI flash in-circuit with flashrom, using an ESP32-S3 dev board as serprog programmer or a Pico/CH341A. Use when the OS cannot write the flash.
How do I install the bios-external-programmer skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the bios-external-programmer skill run scripts?
Yes, this skill bundles executable scripts. Review the source before installing.
Related skills
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
by Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
by Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
by Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
by Anthropic