Raspberry Pi Pico Update: Difference between revisions
m (→Overview) |
m (Corrected filename for gzip compressed fpga cores) |
||
| (3 intermediate revisions by one other user not shown) | |||
| Line 3: | Line 3: | ||
=== Overview === | === Overview === | ||
There is an onboard RP2040 chip (pi pico). It is | There is an onboard RP2040 chip (pi pico). It is NOT PRESENT on the Jr2. It's only present on the K2. It's responsible for the following things: | ||
* the bootloader procedure that loads the right core while booting the K2. | * the bootloader procedure that loads the right core while booting the K2. | ||
* it is also known as the "FPGA Manager" | * it is also known as the "FPGA Manager" | ||
* Has modifiable code that can invite more features and possibly a faster bootup | * Has modifiable code that can invite more features and possibly a faster bootup | ||
=== Preparing new pico flash files === | |||
Check this [https://github.com/wildbitscomputing/fpga-manager fpga manager] repo from Cibee which can tweak and compile such files into .uf2. This project uses VSCode, the pico sdk and openocd in order to do everything. | |||
Here's a summary of the booting time gains that were accomplished by Cibee (see the benchmark table on the side) | |||
bit bang (slowest): was the old method, at launch of the K2, of sending a core file to the FPGA. | |||
pio (faster): is the new method tried by Cibee | |||
SD raw (slowest): was the old way of storing the core file, uncompressed, as .bin files. See [[FPGA_Releases#How_to_Upgrade_the_FPGA_for_the_F256K2]] for the exact file structure needed inside the internal "left" uSD card. | |||
SD gzip (faster): is a new method of individually storing those same core files as .bin.gz, reducing the amount of bytes to send dramatically | |||
FLASH LZ4 (fastest): is embedding the core files inside the pi pico flash memory so that the core manager carries its own data and sends it to the fpga during bootup. This no longer involves the internal "left" uSD card at all. | |||
When a recent enough fpga manager (January 2026) is flashed into the pi pico, it will try to prepare the fpga with this following sequence: | |||
<nowiki>*</nowiki> Reads a 2-bit context DIP switch to select one of four FPGA slots. | |||
<nowiki>*</nowiki> Attempts SD card programming first (LZ4 blocks, gzip, then raw .bin). | |||
<nowiki>*</nowiki> Falls back to LZ4 images stored in fixed flash slots if SD is unavailable. | |||
<nowiki>*</nowiki> Prints the chosen method and timing over USB stdio if enabled. | |||
[[File:FPGA Manager Benchmark.png|thumb]] | |||
=== Opening the case === | === Opening the case === | ||
| Line 14: | Line 42: | ||
You can refer to this section to learn how you can be [[Opening_the_F256K_case]] | You can refer to this section to learn how you can be [[Opening_the_F256K_case]] | ||
=== Flashing using the onboard USB Header === | |||
Here are the steps to follow: | |||
[[File:Rp2040-cable.jpeg|thumb|Connector location for the pico USB pin header, Switch S3 on the left, and cable orientation]] | |||
Installation step: | |||
* Install Cable as above (F256K2 Powered Off). '''WARNING''', with '''VERY LITTLE''' cable tension, this pin header can snap off [from Mu0n] and force you onto the next method of flashing using the SWD header, as seen in the next section. | |||
* Plug Cable in any PC that holds the new programming file. | |||
* Keep 1 finger on the button | |||
* Power the F256K2 | |||
* A new folder will appear on the PC's Desktop | |||
* Drop the new .uf2 file in the newly appeared folder. | |||
* Power off F256K2 | |||
* Remove cable | |||
* Reinstall the system as your heart's desire | |||
* Power On the unit | |||
* RP2040 is updated and running (because you need it to boot the unit) | |||
* Bob's your uncle! | |||
=== Flashing using the onboard SWD Header === | |||
SWD: Serial Wire Debug. This other pin header is a second way to update your flash and gives a little more flexibility to do it piece by piece by flashing .bin at specific flash locations or .elf in one go. | |||
[[File:Swd connector.png|thumb|Connector location for the SWD pin header, near the FPGA]] | |||
You'll need either: | |||
* | * a [https://www.raspberrypi.com/documentation/microcontrollers/debug-probe.html Pi Debug Probe] which comes with the necessary cable that leads to 3 female Dupont endings needed here | ||
* | * openocd tool from PicoSDK v1.5.1 or more recent | ||
* | * a prepared .bin file with updated code. | ||
* | * a conversion tool to convert .uf2 to .bin, you can use this website https://polpo.org/tmp/uf2-to-bin.html or other known tools in the pico community | ||
* | * the key step is to use openocd like so: openocd -s scripts -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "adapter speed 5000; program NewFirmware.bin verify reset exit 0x10000000" | ||
Latest revision as of 18:14, 14 February 2026
Raspberry Pi Pico Update
Overview
There is an onboard RP2040 chip (pi pico). It is NOT PRESENT on the Jr2. It's only present on the K2. It's responsible for the following things:
- the bootloader procedure that loads the right core while booting the K2.
- it is also known as the "FPGA Manager"
- Has modifiable code that can invite more features and possibly a faster bootup
Preparing new pico flash files
Check this fpga manager repo from Cibee which can tweak and compile such files into .uf2. This project uses VSCode, the pico sdk and openocd in order to do everything.
Here's a summary of the booting time gains that were accomplished by Cibee (see the benchmark table on the side)
bit bang (slowest): was the old method, at launch of the K2, of sending a core file to the FPGA.
pio (faster): is the new method tried by Cibee
SD raw (slowest): was the old way of storing the core file, uncompressed, as .bin files. See FPGA_Releases#How_to_Upgrade_the_FPGA_for_the_F256K2 for the exact file structure needed inside the internal "left" uSD card.
SD gzip (faster): is a new method of individually storing those same core files as .bin.gz, reducing the amount of bytes to send dramatically
FLASH LZ4 (fastest): is embedding the core files inside the pi pico flash memory so that the core manager carries its own data and sends it to the fpga during bootup. This no longer involves the internal "left" uSD card at all.
When a recent enough fpga manager (January 2026) is flashed into the pi pico, it will try to prepare the fpga with this following sequence:
* Reads a 2-bit context DIP switch to select one of four FPGA slots.
* Attempts SD card programming first (LZ4 blocks, gzip, then raw .bin).
* Falls back to LZ4 images stored in fixed flash slots if SD is unavailable.
* Prints the chosen method and timing over USB stdio if enabled.

Opening the case
You can refer to this section to learn how you can be Opening_the_F256K_case
Flashing using the onboard USB Header
Here are the steps to follow:

Installation step:
- Install Cable as above (F256K2 Powered Off). WARNING, with VERY LITTLE cable tension, this pin header can snap off [from Mu0n] and force you onto the next method of flashing using the SWD header, as seen in the next section.
- Plug Cable in any PC that holds the new programming file.
- Keep 1 finger on the button
- Power the F256K2
- A new folder will appear on the PC's Desktop
- Drop the new .uf2 file in the newly appeared folder.
- Power off F256K2
- Remove cable
- Reinstall the system as your heart's desire
- Power On the unit
- RP2040 is updated and running (because you need it to boot the unit)
- Bob's your uncle!
Flashing using the onboard SWD Header
SWD: Serial Wire Debug. This other pin header is a second way to update your flash and gives a little more flexibility to do it piece by piece by flashing .bin at specific flash locations or .elf in one go.

You'll need either:
- a Pi Debug Probe which comes with the necessary cable that leads to 3 female Dupont endings needed here
- openocd tool from PicoSDK v1.5.1 or more recent
- a prepared .bin file with updated code.
- a conversion tool to convert .uf2 to .bin, you can use this website https://polpo.org/tmp/uf2-to-bin.html or other known tools in the pico community
- the key step is to use openocd like so: openocd -s scripts -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "adapter speed 5000; program NewFirmware.bin verify reset exit 0x10000000"