🛠 Boot UF2, mode BOOTSEL et recovery d'une carte briquée

Raspberry Pi Pico 2 · avance · Schéma : IMG-pico-2-avance-2-pico2-boot-uf2-bootsel-recovery.svg — chaîne de boot du RP2350 : ROM de boot inaltérable, choix flash QSPI ou USB BOOTSEL, et étapes de recovery d'une Pico 2 briquée

Objectives

Understand the RP2350 boot chain: the USB boot code resides in ROM and cannot be overwritten — making a Pico 2 nearly impossible to permanently brick. You will learn about BOOTSEL mode, the UF2 format, the picotool/MSD tools, and how to recover a card that no longer boots (bad firmware, RP2040 binary, misconfigured secure boot).

Hardware

Full Code

/* saut_vers_bootsel.c — depuis le programme, retourne au mode UF2
   Utile pour un produit : mise a jour sans ouvrir le boitier. */
#include "pico/stdlib.h"
#include "pico/bootrom.h"

#define BTN_PIN 22

int main(void) {
    gpio_init(BTN_PIN); gpio_set_dir(BTN_PIN, GPIO_IN); gpio_pull_up(BTN_PIN);
    stdio_init_all;
    sleep_ms(2000);                       /* fenetre pour ouvrir le terminal */
    printf("Appui long sur GP22 -> mode BOOTSEL (lecteur RPI-RP2)\n");
    while (gpio_get(BTN_PIN)) sleep_ms(10);
    rom_reset_to_bootsel;               /* ne revient jamais */
}

Recovery procedure without code: 1) Hold BOOTSEL and plug in USB; 2) The RPI-RP2 drive appears (the ROM always responds); 3) Copy a valid UF2 (pico2!) to overwrite the flash; 4) The card restarts. Inventory: picotool info -a and picotool reboot -u (USB reboot) from any UF2 firmware.

Expected Verification

Regardless of what garbage is flashed (RP2040 binary, looping program, saturated RAM), holding BOOTSEL while plugging in makes the RPI-RP2 drive reappear, and a valid pico2 UF2 restores the card. picotool info displays the Pico 2 (RP2350) in USB boot mode.

Common Errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials