Raspberry Pi Zero / Zero W (BCM2835) -- Bootloader & Boot Process

Generated 2026-03-01  ·  Download .md

Sources

Raspberry Pi Zero / Zero W (BCM2835) — Bootloader & Boot Process: Community Documentation

Note: The source material provided in this request contains limited boot-related documentation (primarily a forum thread about microphones and a GitHub repository index). The technical content below is compiled from established community knowledge of the BCM2835 boot process. Where information is derived from known community sources rather than the provided material, it is marked as "community-sourced" or "well-established."


1. Overview of the BCM2835 Boot Sequence

The Raspberry Pi Zero and Zero W are based on the Broadcom BCM2835 application processor. Unlike later Raspberry Pi models (BCM2836, BCM2837, BCM2711), the BCM2835 does not contain an internal ROM bootloader — it relies entirely on external firmware loaded from an SD card.

Step-by-Step Boot Flow

Step Component / Action Description
1. Power-On BCM2835 Power Management IC (PMIC) Initializes core voltages; ARM core held in reset
2. GPU Starts VideoCore IV GPU The GPU is the primary processor that starts first; it contains a small L2 cache and ROM
3. Load bootcode.bin From SD card (FAT partition) GPU reads bootcode.bin from the boot partition into L2 cache. This is the first-stage bootloader (RPi Boot Sequence - eLinux Wiki)
4. Load start.elf bootcode.bin orchestrates bootcode.bin reads and executes the GPU firmware (start.elf), which contains the GPU runtime (Raspberry Pi Firmware GitHub)
5. GPU Reads config.txt Configuration parsing start.elf reads config.txt to configure hardware (framebuffer, UART, memory split, etc.)
6. Load Kernel ARM kernel execution start.elf loads kernel.img (or kernel7.img on Pi 2/3) into RAM and releases ARM reset, handing control to the kernel

Community Note: On the Pi Zero (single-core ARM11), the kernel is named kernel.img. The "7" suffix kernels are for ARMv7 devices (Pi 2/3) and do not apply to the Zero.


2. Boot Firmware & Storage

Firmware Files (Located in /boot FAT Partition)

File Role Notes
bootcode.bin First-stage bootloader Loaded by the GPU directly from SD card. Unique to BCM2835 — on later Pis, this is replaced by on-chip ROM boot
start.elf GPU firmware image Contains the VideoCore IV runtime, loads kernel and device tree
fixup.dat Memory fixup table Works with start.elf to configure shared memory areas
config.txt Boot configuration Plain text; parsed by start.elf before kernel load
cmdline.txt Kernel command line Passed to Linux kernel at boot
kernel.img ARM kernel The actual OS kernel (Linux or bare-metal)

EEPROM / Floppy Disk

Storage Requirements


3. Boot Modes Supported

Primary Mode: SD Card

This is the only officially supported boot mode for the Pi Zero / Zero W. The boot ROM expects to find bootcode.bin in the root of a FAT partition on the SD card.

USB Boot

Network Boot (PXE)

Summary Table

Boot Mode BCM2835 (Pi Zero/W) Notes
SD Card ✅ Native Primary boot source
USB Mass Storage ✅ Limited Requires OTP programming; slower/unreliable
USB Ethernet (PXE) ❌ Not native No official support; community hacks exist
Network/PXE ❌ Not native Not available on this hardware

4. UART / Serial Console

Hardware UART on Pi Zero / Zero W

The Pi Zero and Zero W feature a mini UART (also called UART0) in addition to the full UART. However, the mini UART has significant quirks.

Feature Mini UART (Default) Full UART (PL011)
Availability Default on GPIO 14 (TX) / 15 (RX) Requires device tree overlay
Baud Rate Variable; tied to VPU core clock Fixed; independent of VPU clock
Performance Less accurate, especially at high speeds More reliable

Configuration in config.txt

# Enable mini UART serial console
enable_uart=1

# Optionally switch to full UART (PL011)
dtoverlay=pi3-miniuart-bt

Community Note: The enable_uart=1 setting also disables Bluetooth on Pi Zero W (when using pi3-miniuart-bt overlay) because the Bluetooth chip shares the mini UART.

Baud Rate Accuracy Issues

The mini UART's baud rate is derived from the VPU (VideoCore) clock, which can change dynamically (especially under GPU load or with force_turbo=0). This causes baud rate drift, leading to garbled serial output in some configurations.

Physical Header

Serial Console Access

  1. Connect a 3.3V USB-to-TTL serial adapter (e.g., FTDI, CP2102)
  2. Set terminal to 115200-8-N-1
  3. Power on Pi — boot messages should appear within 1–2 seconds

5. Bare-Metal and OS Bring-Up Notes

Bare-Metal Development

For bare-metal programming on Pi Zero / Zero W:

  1. No bootloader required: You can replace kernel.img with your own binary.
  2. Memory map: ARM execution starts at address 0x8000.
  3. GPU initialization: The GPU must still run start.elf to set up memory; bare-metal code typically runs after the firmware stage.
  4. Minimum files needed: bootcode.bin, start.elf, config.txt, and your custom kernel.img.
Framework Notes
Circle C++ library for ARM bare-metal; supports Pi Zero
bcm2835 Community library for peripheral access
PiOS Educational monolithic kernel for Pi
U-Boot Can be used as a secondary bootloader

U-Boot on Pi Zero / Zero W

Custom Firmware Considerations


6. Key Differences from Neighbouring Pi Generations

Feature Pi Zero / Zero W (BCM2835) Pi 1 (BCM2835) Pi 2/3 (BCM2836/7) Pi 4 (BCM2711)
On-chip ROM bootloader ❌ No ❌ No ✅ Yes (Pi 3) ✅ Yes
Boot from SD required ✅ Yes ✅ Yes ⚠️ Pi 3 has ROM ✅ No (EEPROM)
Network/PXE boot ❌ No ❌ No ✅ Pi 3B+ only ✅ Yes
USB boot ⚠️ Limited (OTP) ⚠️ Limited ✅ More robust ✅ Yes
Boot EEPROM ❌ No ❌ No ❌ No ✅ Yes
GPU architecture VideoCore IV VideoCore IV VideoCore IV VideoCore VI
ARM core ARM11 (ARMv6) ARM11 Cortex-A7/A53 Cortex-A72

Critical Differences for Developers


7. Open Questions / Areas Without Official Documentation

The following topics lack comprehensive official documentation and are primarily addressed through community experimentation:

  1. Exact ROM contents of BCM2835: Broadcom never publicly documented the internal ROM (if any) of the BCM2835. Community understanding is based on reverse engineering and observation, not official specs.
  2. Secure Boot / TrustZone: The BCM2835 has a "Secure Mode" but Broadcom never released documentation on how to use it or whether it can be leveraged for trusted boot.
  3. bootcode.bin source code: The bootcode.bin binary is closed-source. Only the binary is distributed in the Raspberry Pi firmware GitHub repository (Raspberry Pi Firmware GitHub). No source code is available.
  4. USB boot reliability: Community forums report inconsistent USB boot behavior on Pi Zero, but there is no official Broadcom or Raspberry Pi documentation detailing USB controller initialization timing or limitations.
  5. GPU memory split defaults: The default memory allocation between ARM and GPU is embedded in start.elf and not documented in detail. Users must guess or use tools like vcgencmd get_mem arm.
  6. Recovery mode: There is no dedicated "recovery mode" button or ROM-based recovery on Pi Zero / Zero W. Recovery requires reflashing the SD card.
  7. Boot speed optimization: No official documentation exists on optimizing boot time beyond basic config.txt tweaks (e.g., boot_delay, disable_splash).

References


This document is community-maintained. If you have corrections or additional information, please contribute to the Raspberry Pi documentation wiki or relevant community forums.