🛠 Boot sur SD et procédure de recouvrement
Objectives
Understand the boot chain of the Model B Rev 2 (BCM2835 ROM reading bootcode.bin from the FAT partition of a full-size SD card) and learn how to restore a non-working card to service: USB boot does not exist on this generation, the SD card is the only path.
Hardware
- Raspberry Pi Model B Rev 2, full-size SD card (no bare microSD: the connector is SD 2.0)
- SD card reader on a PC, 32-bit legacy Raspbian image, balenaEtcher or
dd - A second healthy SD card for diagnostics
Complete code
# Ecrire une image propre (remplacer /dev/sdX par le lecteur!)
sudo dd if=2021-05-07-raspios-buster-armhf.img of=/dev/sdX bs=4M status=progress conv=fsync
# Recouvrement sans reecrire: monter la partition boot sur le PC et reparer
# - config.txt invalide -> supprimer/renommer config.txt (valeurs par defaut)
# - noyant absent -> copier bootcode.bin, start.elf, fixup.dat, kernel*.img
# Diagnostic carte usee (la SD est le defaut materiel n1 de l'ere 2012-2014):
sudo fsck.vfat -v /dev/sdX1
# Sur la carte montee, tracer les demarrages:
sudo touch /boot/ssh ; cat /boot/cmdline.txt | grep root=
Expected verification
After writing, the card boots: green activity LED, HDMI output displayed. In recovery, renaming a broken config.txt restores startup to default values; the green LED blinks according to the error code if the firmware is missing (regular blinks = bootcode not found).
Common errors
- Writing the image to a partition instead of the raw disk (
/dev/sdX1instead of/dev/sdX): the card remains blank. - Low-quality microSD adapter in the full-size connector: random corruption, poor contacts.
- Believing in USB boot or an EEPROM: the BCM2835 only reads the SD card, no alternative recovery mode exists.
- Ignoring undervoltage: a tired F1 polyfuse causes intermittent boot failures, making the card seem "dead" intermittently.
Other tutorials for this board
Code examples for this board
led_blink.pyPythonbutton_led.pyPythonservo_sweep.pyPythondht_temp.pyPythonoled_i2c.pyPythonmcp3008_read.pyPython