Getting Started with Raspberry Pi 5 on Debian

The Raspberry Pi 5 is a genuine leap over the Pi 4 — faster CPU, PCIe, a real power button, and an RTC header. Running it on Raspberry Pi OS (Debian Bookworm underneath) is the path of least resistance. This covers initial setup, what's different from older Pi's, and the gotchas worth knowing before you sink time into a project.

What's New in the Pi 5

FeaturePi 4Pi 5Notes
CPUCortex-A72, 4-core 1.8GHzCortex-A76, 4-core 2.4GHzRoughly 2–3× faster in practice
PCIeNone (USB 3 only)PCIe 2.0 x1 via M.2 HATNVMe SSDs, proper disk I/O
PowerUSB-C, no buttonUSB-C 5A, physical power buttonNeeds 5V/5A supply; 5V/3A works at reduced speed
RTCNoYes (with backup battery connector)Keeps time without NTP if you add the coin cell
PMICSeparate from SoCIntegrated RP1 I/O chipGPIO is now via RP1, not directly SoC
Active coolingOptionalRequired for sustained loadThe official active cooler fits the mounting holes

Flashing the SD Card

# Use Raspberry Pi Imager (easiest — can pre-configure SSH, hostname, wifi)
# https://www.raspberrypi.com/software/

# Or flash manually with rpi-imager CLI / dd:
$ xzcat 2024-11-19-raspios-bookworm-arm64.img.xz | dd of=/dev/sdX bs=4M status=progress

# After flashing, the boot partition is FAT32 — mountable on any OS.
# For headless setup, create an empty file called 'ssh' on the boot partition:
$ touch /mnt/boot/ssh

# For wifi, create wpa_supplicant.conf on the boot partition.
# On Bookworm this moved to /etc/NetworkManager/ — use Imager instead.

Raspberry Pi Imager's "advanced options" (gear icon) lets you set hostname, SSH key, and wifi before writing the image — this is the smoothest headless path and avoids touching config files on the boot partition.

First Boot

# Find the Pi on your network
$ nmap -sn 192.168.1.0/24 | grep -i raspberry
# Or check your router's DHCP table

# SSH in (default user is now 'pi' only if you set it in Imager)
$ ssh pi@raspberrypi.local     # mDNS works on most networks
$ ssh pi@192.168.1.xxx         # or use the IP directly

# Update immediately — Bookworm ships with older package snapshots
$ sudo apt update && sudo apt full-upgrade -y
$ sudo reboot

raspi-config

$ sudo raspi-config
SectionWhat to set
System Options → HostnameSomething meaningful — you'll have multiple Pi's
Interface Options → SSHEnable if not done at imaging time
Interface Options → I2C / SPIEnable what your HATs need
Interface Options → Serial PortEnable hardware UART, disable login shell on serial
Performance Options → GPU MemorySet to 16MB for headless (saves RAM)
Localisation → TimezoneSet correctly — matters for logs and the RTC

Power Supply

The Pi 5 is fussier about power than older models. The official 27W USB-C supply (5V/5A) is the only one that fully satisfies it. A 5V/3A supply works but triggers an undervoltage warning in dmesg and throttles the CPU under load. Check with:

$ vcgencmd get_throttled
# 0x0 = all good
# 0x50000 = throttled (under-voltage has occurred)
# 0x50005 = currently throttled

$ vcgencmd measure_temp
# Keep it below 80°C under sustained load
# The active cooler holds it around 50-60°C typically

GPIO Differences

On Pi 5, GPIO is handled by the RP1 I/O controller chip rather than directly by the SoC. The 40-pin header pinout is identical to previous Pi's, but the underlying driver changed. Libraries that speak directly to BCM registers (like some older versions of RPi.GPIO) don't work. Use the updated libraries:

# RPi.GPIO — older, works via the new kernel driver on Pi 5 with recent updates
$ pip3 install RPi.GPIO

# gpiozero — higher-level, recommended for most uses
$ pip3 install gpiozero

# lgpio — the new recommended low-level library for Pi 5
$ pip3 install lgpio

# Test GPIO is working (LED on GPIO 17):
$ python3 -c "
from gpiozero import LED
from time import sleep
led = LED(17)
led.on(); sleep(1); led.off()
"

NVMe via M.2 HAT

The Pi 5's PCIe slot makes NVMe SSDs viable as the primary disk for the first time. The official M.2 HAT+ mounts under the Pi and connects to the PCIe FPC connector:

# After fitting the HAT and NVMe drive, check it's visible:
$ lspci
# Should show something like: 01:00.0 Non-Volatile memory controller: ...

$ ls /dev/nvme*
# /dev/nvme0  /dev/nvme0n1

# Enable PCIe Gen 3 (faster, but official rating is Gen 2 — test stability):
# In /boot/firmware/config.txt:
dtparam=pciex1_gen=3

# To boot from NVMe, flash the NVMe with the OS image and set boot order:
$ sudo raspi-config → Advanced Options → Boot Order → NVMe/USB Boot

References

For a 64-bit Raspberry Pi OS user-space assembly study, see Raspberry Pi 5 Assembly: BCM2712, Cortex-A76, and AArch64 Linux.