Go to file
kay e75e3a20e6 Fix undefined cs variable
Attempting to compile without this fix results in this error
main.c:226:9: error: 'cs' undeclared (first use in this function)
  226 |         cs = readbyte_blocking();
      |         ^~
This fix declares `cs` as a `uint8_t`. Tested and was able to read/write to a MX25L6406E and MX25L3206E
2024-02-11 20:36:22 +02:00
.gitignore Improve performance 2021-08-07 00:04:38 +01:00
99-serprog.rules Add udev rule to create /dev/serprog0, 1, 2, ... 2023-09-05 19:53:33 +03:00
CMakeLists.txt Make USB descriptor less generic 2023-09-04 21:33:59 +03:00
COPYING Init 2021-04-03 18:36:40 +02:00
COPYING.CC-BY-SA Add CC-BY-SA 4.0 International license 2023-09-01 05:34:27 +03:00
main.c Fix undefined cs variable 2024-02-11 20:36:22 +02:00
pico_sdk_import.cmake Init 2021-04-03 18:36:40 +02:00
pinout.png Add pinout.png 2023-09-01 05:28:07 +03:00
readme.md update readme 2024-01-31 23:01:32 +02:00
serprog.h add support for multiple chip selects 2024-01-15 19:28:00 +02:00
tusb_config.h Use TinyUSB directly instead of the SDK's stdio layer 2021-08-07 02:42:16 +01:00
usb_descriptors.c Include board name in product string 2023-09-04 22:03:35 +03:00


Slightly less terrible serprog implementation for the Raspberry Pi Pico and other RP2040 based boards. Based on pico-serprog by stacksmashing. Further improved by kukrimate here. And me (Riku_V) here.

Pre-compiled binaries binaries can be downloaded from the Libreboot project.

For a guide on how to flash a chip see this page.

This takes about 17 seconds to read the 8MiB BIOS chip of an X200.

Pinout for the SPI lines:

Pin Function
7 CS

Pico pinout


cmake .

Plug in your Pico. Mount it as you would any other USB flash drive. Copy pico_serprog.uf2 into it. Your programmer is now ready. If you want to change the firwmare, you need to press the button on the board while you plug it in.


Substitute ttyACMx with the actual tty device corresponding to the firmware. You can find this by running dmesg -wH. When you plug in the device, a line containing something like this will appear:

[453876.669019] cdc_acm 2-1.2:1.0: ttyACM0: USB ACM device

Read chip:

flashprog -p serprog:dev=/dev/ttyACMx,spispeed=32M -r flash.bin

Write chip:

flashprog -p serprog:dev=/dev/ttyACMx,spispeed=32M -w flash.bin

Multiple chips can be connected at the same time. Pins GP5-GP8 are Chip Selects 0-3, respectively. The firmware defaults to using Chip Select 0.

flashprog -p serprog:dev=/dev/ttyACMx,cs=0 -r chip0.bin
flashprog -p serprog:dev=/dev/ttyACMx,cs=1 -r chip1.bin


As a lot of the code itself was heavily inspired/influenced by stm32-vserprog this code is licensed under GPLv3.

pinout.png is based on pico-pinout.svg by Raspberry Pi Ltd, under the Creative Commons Attribution-ShareAlike 4.0 International license.