Raspberry Pi 5 PCIe Gen 3: Enable 8 GT/s on the External PCIe Connector and Verify the Link Speed

Raspberry Pi 5 runs its external PCIe x1 link at Gen 2 by default. Enable Gen 3 with dtparam=pciex1_gen=3, verify with lspci LnkSta, know the risks.

Short answer: The external PCIe connector on the Raspberry Pi 5 runs PCIe Gen 2.0 x1 (5 GT/s) by default. To switch it to PCIe Gen 3.0 (8 GT/s), add dtparam=pciex1_gen=3 to /boot/firmware/config.txt, or use raspi-config → Advanced Options → PCIe Speed, then reboot. Raspberry Pi states that the Pi 5 is not certified for Gen 3.0, so the link may be unstable. Check the negotiated speed with sudo lspci -vv (the LnkSta line).

Illustration of a Raspberry Pi 5 board with high-speed PCIe signal traces

Raspberry Pi 5 PCIe lanes: what runs at which speed

The BCM2712 SoC on the Raspberry Pi 5 drives two PCIe links. One goes to RP1, Raspberry Pi’s own I/O controller. RP1 handles USB, Gigabit Ethernet, the MIPI camera/display transceivers and GPIO. The other goes to the new 16-pin, 0.5 mm pitch FPC connector on the left edge of the board, which is meant for fast peripherals such as NVMe drives on an M.2 HAT+.

LinkLanesDefaultGen 3.0 option
BCM2712 → RP1 (USB, Ethernet, MIPI, GPIO)x4, PCIe 2.0 (16 Gb/s)Gen 2.0Not affected by pciex1_gen
External FPC connector (M.2 HAT+, NVMe, other PCIe devices)x1Gen 2.0, 5 GT/s (~500 MB/s peak)dtparam=pciex1_gen=3, 8 GT/s, not certified

Only the external x1 link changes. Gen 3.0 roughly doubles its raw signalling rate, from 5 GT/s to 8 GT/s. That is why NVMe benchmarks on the Pi 5 improve noticeably when the drive and the adapter can handle it.

How to enable PCIe Gen 3 on the Raspberry Pi 5

Current Raspberry Pi OS keeps config.txt in the boot partition at /boot/firmware/config.txt. The original version of this post used /boot/config.txt, which was the path on older images. Edit whichever file your image actually boots from.

Option 1: config.txt

  1. If the device is not a HAT+ board, turn on the connector first. HAT+ devices are detected automatically, so they don’t need this line. nvme is an alias for pciex1.
  2. Add the Gen 3 line and reboot with sudo reboot.
# /boot/firmware/config.txt
dtparam=pciex1
dtparam=pciex1_gen=3

The Raspberry Pi kernel overlay README describes both parameters. pciex1 “enable[s] the external PCIe link” (default off), and pciex1_gen sets the GEN/speed of that link (default 2).

Option 2: raspi-config

  1. Run sudo raspi-config.
  2. Select Advanced Options → PCIe Speed.
  3. Choose Yes to enable PCIe Gen 3 mode, then Finish.
  4. Reboot with sudo reboot.

Check the PCIe link speed with lspci

After the reboot, look at the link capability and status of the PCIe devices. You need lspci from the pciutils package.

sudo lspci -vv | grep -E "^[0-9a-f]|LnkCap:|LnkSta:"
  • LnkCap shows what the device or port supports.
  • LnkSta shows what was actually negotiated. For the external connector and the device behind it, Speed 8GT/s with Width x1 means Gen 3.0 is active. 5GT/s means the link is still at Gen 2.0.
  • The output also lists the RP1 link. That one stays at Gen 2.0, which is expected.

Is PCIe Gen 3 on the Raspberry Pi 5 safe?

Raspberry Pi’s documentation says the Raspberry Pi 5 isn’t certified for Gen 3.0 speeds and that Gen 3.0 connections might be unstable. Whether it works depends on the ribbon cable, the adapter board and the device. If the drive doesn’t enumerate, disappears, or logs PCIe/NVMe errors in dmesg, go back to the default: remove the pciex1_gen=3 line (or set it to 2) and reboot. Don’t enable Gen 3 on a system you can’t afford to debug, especially if you boot from the NVMe drive.

Booting the Raspberry Pi 5 from NVMe

In most homelab builds, the reason to care about PCIe speed is an NVMe boot drive. Boot from PCIe is not enabled by default. Edit the bootloader configuration with sudo rpi-eeprom-config --edit and set:

BOOT_ORDER=0xf416
# only for a non-HAT+ adapter:
PCIE_PROBE=1

Save and reboot to write the EEPROM. The official M.2 HAT+ (2230/2242) and M.2 HAT+ Compact (2230) are specified as single-lane PCIe 2.0 adapters with up to 3 A for the M.2 device. Anything above Gen 2.0 on them falls under the same “not certified” caveat.

Sources

Further reading (benchmarks): Jeff Geerling: Forcing PCI Express Gen 3.0 speeds on the Pi 5 and Testing PCIe on the Raspberry Pi 5.

Related on vdan.cz