re-organise the pico flashing instructions

the instructions were a bit crap, for example it wasn't
clear that you can get the firmawre pre-compiled in canoeboot
releases. adapt it accordingly.

Signed-off-by: Leah Rowe <leah@libreboot.org>
master
Leah Rowe 2025-01-08 17:22:26 +00:00
parent 5c20fc539e
commit bd0547db79
2 changed files with 127 additions and 40 deletions

View File

@ -44,6 +44,9 @@ is called *external* because it's not the *internal* one on your mainboard.
Raspberry Pi Pico
=================
RP2040/RP2530 both supported
----------------------------
**Pico 2 and other RP2530 dongles also supported, on Canoeboot 20250107
or higher. Releases before this only supported the original Pico, and other
RP2040 dongles; newer Canoeboot releases now support both RP2040 and RP2530.**
@ -60,30 +63,67 @@ Additionally, all the software running on it is free, down to the full
versions (Pico W & Pico WH) need vendor firmware to use the Wi-Fi chip,
but that is not needed for following this guide.
A Pico has proper 3.3V logic levels, unlike a ch341a. Which means it won't
destroy your board by sending 5V to it. If you have a 1.8V flash chip,
you need to add a logic level converter.
Download serprog firmware pre-compiled
-------------------------
Download the pico serprog tarball from Canoeboot releases. For example, the
Canoeboot 20250107 one would be
named: `canoeboot-20250107_pico_serprog.tar.xz` - it's available under
the `roms/` directory in each release. With these binaries, you can easily
get started.
Build serprog firmware from source
----------------------------------
You can alternatively download the serprog firmware here:\
<https://codeberg.org/libreboot/pico-serprog>\
or here:\
<https://notabug.org/libreboot/pico-serprog>
You can also find the source code for these, under `src/` in Canoeboot release
archives (source code tarball), and/or under `src/` in `cbmk.git` if downloading
using the build instructions below.
Alternatively to the binaries, you
could build it yourself or you could also clone `cbmk.git` and [install build
dependencies](../build/#first-install-build-dependencies), then inside cbmk,
do:
./mk -b pico-serprog
This will automatically build the rpi-pico firmware, and the file will be
at `bin/serprog_pico/serprog_pico.uf2`
and `bin/serprog_pico/serprog_pico_w.uf2` - images with `pico2` in the
file name are for the Pico 2, and they can also be used.
Install the serprog firmware
----------------------------
First, connect just the Pico to your computer with a micro-USB cable.
Mount it like any other USB flash drive. If it isn't detected, you might need
to press the BOOTSEL button while you plug it in (this forces it into the
bootloader mode).
You can also find the source code for these, under `src/` in Canoeboot release
archives (source code tarball), and/or under `src/` in `cbmk.git` if downloading
using the build instructions below.
When you have the build, or if you're using a release build, copy the
file `.uf2` file into your Pico. You must make sure to build the correct
target, or otherwise copy the correct file, because many RP2040 and RP2530
devices exist and Canoeboot provides images for **all of them** in the same
release tarball.
Copy the file `rpi-pico-serprog.uf2` into your Pico. To build this firmware, you
could build it yourself or you could also clone `cbmk.git` and [install build
dependencies](..//build/#first-install-build-dependencies), then inside cbmk,
do:
**NOTE: Other RP2040/2530 devices will also work. You just have to match
the right pins and use the correct firmware file!**
./mk -b pico-serprog
Logic levels
------------
This will automatically build the rpi-pico firmware, and the file will be
at `bin/serprog_rp2040/serprog_pico.uf2`
and `bin/serprog_rp2040/serprog_pico_w.uf2` - images with `pico2` in the
file name are for the Pico 2, and they can also be used.
A Pico has proper 3.3V logic levels, unlike a ch341a. Which means it won't
destroy your board by sending 5V to it. If you have a 1.8V flash chip,
you need to add a logic level converter. **Please ensure that you have matched
the voltage of your programmer to the voltage of your chip; both the data lines
and power lines to the chip must match.**
Wiring
------
Disconnect the Pico and proceed to wire it to your
[flash chip](/docs/install/spi.html#identify-which-flash-type-you-have).
@ -97,6 +137,8 @@ above](https://av.canoeboot.org/rpi_pico/pinout_serprog.png)
![A Raspberry Pi Pico connected to a SOIC16 flash
chip](https://av.canoeboot.org/rpi_pico/soic16_x200.webp)
![SOIC-8 to Pico pinout diagram](https://av.libreboot.org/rpi_pico/soic8_pico_pinouts.jpg)
Headers were manually soldered on the top side, and the plastic packaging
was repurposed as an insulating base. These might be nice to have, but by no
means necessary. If your headers are on the other side, just keep in mind
@ -107,7 +149,7 @@ will appear:
[453876.669019] cdc_acm 2-1.2:1.0: ttyACMx: USB ACM device
Take note of the ttyACMx. Flashrom is now usable
Take note of the ttyACMx. Flashprog is now usable
(substitute ttyACMx with what you observed earlier).
flashprog -p serprog:dev=/dev/ttyACMx,spispeed=16M
@ -115,15 +157,7 @@ Take note of the ttyACMx. Flashrom is now usable
spispeed=32M usually works, but since it's not much faster it's probably
not worth it. The 12Mbps USB port is limiting the actual speed here.
Raspberry Pi Pico SOIC-8 wiring
-------------------------------
When using a Raspberry Pi Pico to program a SOIC-8 flash chip with
`pico-serprog`, you may use the following diagram, which contains the
Raspberry Pi Pins and the pinouts of the typical SOIC-8 chip to wire up
your programmer:
![SOIC-8 to Pico pinout diagram](https://av.canoeboot.org/rpi_pico/soic8_pico_pinouts.jpg)
Higher speeds might work nicely, on Pico 2.
Do not use CH341A!
==================
@ -497,7 +531,7 @@ at <https://flashprog.org/>
If you're flashing a Macronix flashchip on a ThinkPad X200, you will want to
use a special patched version of flashprog, which you can download like so
in lbmk:
in cbmk:
./mk -b flashprog

View File

@ -25,6 +25,9 @@ canoeboot 目前记录了这些 SPI 编程器的使用方法:
Raspberry Pi Pico
=================
RP2040/RP2530 both supported
----------------------------
**Pico 2 and other RP2530 dongles also supported, on Canoeboot 20250107
or higher. Releases before this only supported the original Pico, and other
RP2040 dongles; newer Canoeboot releases now support both RP2040 and RP2530.**
@ -41,33 +44,81 @@ Additionally, all the software running on it is free, down to the full
versions (Pico W & Pico WH) need vendor firmware to use the Wi-Fi chip,
but that is not needed for following this guide.
A Pico has proper 3.3V logic levels, unlike a ch341a. Which means it won't
destroy your board by sending 5V to it. If you have a 1.8V flash chip,
you need to add a logic level converter.
Download serprog firmware pre-compiled
-------------------------
Download the pico serprog tarball from Canoeboot releases. For example, the
Canoeboot 20250107 one would be
named: `canoeboot-20250107_pico_serprog.tar.xz` - it's available under
the `roms/` directory in each release. With these binaries, you can easily
get started.
Build serprog firmware from source
----------------------------------
You can alternatively download the serprog firmware here:\
<https://codeberg.org/libreboot/pico-serprog>\
or here:\
<https://notabug.org/libreboot/pico-serprog>
You can also find the source code for these, under `src/` in Canoeboot release
archives (source code tarball), and/or under `src/` in `cbmk.git` if downloading
using the build instructions below.
Alternatively to the binaries, you
could build it yourself or you could also clone `cbmk.git` and [install build
dependencies](../build/#first-install-build-dependencies), then inside cbmk,
do:
./mk -b pico-serprog
This will automatically build the rpi-pico firmware, and the file will be
at `bin/serprog_pico/serprog_pico.uf2`
and `bin/serprog_pico/serprog_pico_w.uf2` - images with `pico2` in the
file name are for the Pico 2, and they can also be used.
Install the serprog firmware
----------------------------
First, connect just the Pico to your computer with a micro-USB cable.
Mount it like any other USB flash drive. If it isn't detected, you might need
to press the BOOTSEL button while you plug it in (this forces it into the
bootloader mode).
Copy the relevant `.uf2` file into your Pico. To build this firmware, you
could build it yourself or you could also clone `cbmk.git` and [install build
dependencies](..//build/#first-install-build-dependencies), then inside cbmk,
do:
When you have the build, or if you're using a release build, copy the
file `.uf2` file into your Pico. You must make sure to build the correct
target, or otherwise copy the correct file, because many RP2040 and RP2530
devices exist and Canoeboot provides images for **all of them** in the same
release tarball.
./mk -b pico-serprog
**NOTE: Other RP2040/2530 devices will also work. You just have to match
the right pins and use the correct firmware file!**
This will automatically build the rpi-pico firmware, and the file will be
at `bin/serprog_rp2040/serprog_pico.uf2`
and `bin/serprog_rp2040/serprog_pico_w.uf2` - images with `pico2` in the
file name are for the Pico 2, and they can also be used.
Logic levels
------------
A Pico has proper 3.3V logic levels, unlike a ch341a. Which means it won't
destroy your board by sending 5V to it. If you have a 1.8V flash chip,
you need to add a logic level converter. **Please ensure that you have matched
the voltage of your programmer to the voltage of your chip; both the data lines
and power lines to the chip must match.**
Wiring
------
Disconnect the Pico and proceed to wire it to your
[flash chip](/docs/install/spi.html#identify-which-flash-type-you-have).
![Raspberry Pi Pico pinout, when using the firmware linked above](https://av.canoeboot.org/rpi_pico/pinout_serprog.png)
**NOTE: SCK and CLK mean the same thing. The diagram below says SCK, and other
parts of this guide say CLK. It's the same thing!**
![A Raspberry Pi Pico connected to a SOIC16 flash chip](https://av.canoeboot.org/rpi_pico/soic16_x200.webp)
![Raspberry Pi Pico pinout, when using the firmware linked
above](https://av.libreboot.org/rpi_pico/pinout_serprog.png)
![A Raspberry Pi Pico connected to a SOIC16 flash
chip](https://av.libreboot.org/rpi_pico/soic16_x200.webp)
![SOIC-8 to Pico pinout diagram](https://av.libreboot.org/rpi_pico/soic8_pico_pinouts.jpg)
Headers were manually soldered on the top side, and the plastic packaging
was repurposed as an insulating base. These might be nice to have, but by no
@ -87,6 +138,8 @@ Take note of the ttyACMx. Flashprog is now usable
spispeed=32M usually works, but since it's not much faster it's probably
not worth it. The 12Mbps USB port is limiting the actual speed here.
Higher speeds might work nicely, on Pico 2.
不要使用 CH341A
==================