🛠 Amorçage microSD, pannes de boot et procédure de recouvrement
Objectives
Understand the very specific boot chain of the Model B+ — the BCM2835 ROM can only boot from microSD, with no EEPROM memory or USB boot support — and learn how to restore a card that has become unbootable without reinstalling: editing config.txt, using a rescue shell, and checking file systems.
Hardware
- Raspberry Pi Model B+ (BCM2835) and its suspect microSD card
- A PC with a microSD adapter, Raspberry Pi Imager (or Etcher/dd)
- Raspberry Pi OS legacy 32-bit image (Buster or earlier; ARMv6 is no longer supported since Bullseye)
- HDMI monitor + keyboard useful for observing boot messages
Complete code
# 1) Graver proprement une image (sur le PC Linux)
sudo dd if=2021-05-07-raspios-buster-armhf.img of=/dev/sdX bs=4M status=progress conv=fsync
# 2) Sur la carte : la partition 1 est la FAT « boot » lue par le ROM
lsblk -o NAME,SIZE,FSTYPE,MOUNTPOINT /dev/sdX
# bootcode.bin, kernel.img, config.txt, cmdline.txt doivent être à la racine
# 3) Shell de secours : sur le PC, ajouter init=/bin/sh à la fin de cmdline.txt
# (enlever « init=... » existant), booter, changer le mot de passe, retirer la ligne
sudo passwd root
# 4) Réparer une partition root encrassée après une coupure brutale
sudo touch /forcefsck && sudo reboot
# 5) Carte muette : tester une autre microSD, vérifier l'alimentation 5 V, et
# regarder la LED d'alimentation (rouge) — le B+ n'a pas de LED d'activité
# séparée fiable selon les révisions.
Expected verification
With a healthy card, the red LED lights up and the screen displays the boot sequence followed by the login prompt. The rescue shell (init=/bin/sh) provides direct root access: mount -o remount,rw / followed by passwd allows you to recover access. After removing the line and rebooting, the system returns to normal operation.
Common errors
- Attempting USB or network boot: impossible on BCM2835, there is no EEPROM or recovery mode like on Pi 3/4/5 — only microSD boots.
- Accidentally burning a recent image (Bullseye+): ARMv6 is no longer supported, boot fails silently; use a legacy image.
- Modifying cmdline.txt while keeping two
init=parameters: the kernel ignores them or crashes; leave only oneinit. - Worn-out SD card: repeated corruptions after fsck mean it is "trash"; microSD cards have a finite lifespan, replace them before blaming the system.
- Red LED blinking or turning off: undervoltage (polyfuse), change the power supply before any software diagnosis.
Other tutorials for this board
- Allumer une LED depuis la GPIO 17 avec libgpiod
- Lire un bouton et afficher les appuis dans la console
- Premier script Python : faire clignoter la LED
- Variation d'intensité d'une LED avec le PWM matériel (GPIO18)
- Interroger un capteur I2C (BME280) sur le bus du 40 broches
- Mettre le B+ en réseau par Ethernet et piloter en SSH
Code examples for this board
led_blink.pyPythonbutton_led.pyPythonservo_sweep.pyPythondht_temp.pyPythonoled_i2c.pyPythonmcp3008_read.pyPython