Open main menu

Changes

NVMe SSD boot with the Raspberry Pi 5

7,219 bytes added, 16 July
{{GD Template Impl}}
<!--
==<span class="tb_red">READ ME before Starting</span>==
1. '''Enable PCIe''': Must make sure to '''enable PCIe in the OS on the NVME SSD you are booting''', instead of the OS on SD card. Too people just enable PCIe in the OS on the SD CARD.

2. '''Update eeprom firmware''': Check and upgrade the bootloader firmware to the '''latest version''';

3. '''Set NVME boot order''';

4. DON'T enable PCIe 3.0, '''ONLY PCIe 2.0 is supported''' by Raspberry Pi fundation.

5. If your SSD is '''OLD''' and has a '''DOS partition''', delete the DOS partition and repartition the SSD (feedback from buyer)

6. Please visit the guide below for specific operations.


'''[PS]''': The official Raspberry Pi firmware is frequently upgraded and the OS is not stable enough. It is also a challenge for us.
-->

'''This tutorial<ref>Refer to [https://www.jeffgeerling.com/blog/2023/nvme-ssd-boot-raspberry-pi-5 NVM NVMe SSD boot with the Raspberry Pi 5]</ref> describes how to configure the Raspberry Pi OS on PI 5 to get pcie pip working'''

== Important Notes==
{{NVMe SSD Incompatibility List}}

==Enable PCIe==
By default the PCIe connector is not enabled. To enable it you should add the following option into <span class="tb_blue">/boot/firmware/config.txt</span> and <span class="tb_blue">reboot</span>:
sudo nano /boot/firmware/config.txt
Then add the following comment;
# Enable the PCIe External connector.
dtparam=pciex1

# This line is an alias for above (you can use either/or to enable the port).
dtparam=nvme

Press '''Ctrl-O''', then enter, to write the change to the file.

Press '''Ctrl-X''' to exit nano (the editor).


And the connection is certified for Gen 2.0 speed (5 GT/sec), but you can force it to Gen 3.0 (10 GT/sec) if you add the following line after:
dtparam=pciex1_gen=3

<span class="tb_red_bold">WARNING:</span><span class="tb_red">The Raspberry Pi 5 is not certified for Gen 3.0 speeds, and connections to PCIe devices at these speeds may be unstable.</span>

Then DON'T forgot to reboot
sudo reboot

You also can refer to official documentatio:[https://www.raspberrypi.com/documentation/computers/raspberry-pi-5.html#enabling-pcie Enabling PCIe]

After reboot,use the '''lspci''' command to display your PCIe devices
sudo lspci
The output is as follows, note that the content of the third line depends on the NVME control you are using.
<span style="color:green;">pi@raspberrypi:</span> <span style="color:#50BEFF;">~ $</span> sudo lspci
0000:00:00.0 PCI bridge: Broadcom Inc. and subsidiaries Device 2712 (rev 21)
<span class="tb_red">0000:01:00.0 Non-Volatile memory controller: Silicon Motion, Inc. SM2263EN/SM2263XT SSD Controller (rev 03)</span>
0001:00:00.0 PCI bridge: Broadcom Inc. and subsidiaries Device 2712 (rev 21)
0001:01:00.0 Ethernet controller: Device 1de4:0001
* Make sure your NVME SSD is plugged into the PCIe PIP, not just connecting PCIe PIP to the Pi 5, otherwise the '''lspci''' will not be able to display any PCIe device.
* <span class="tb_red">If your NVMe SSD is not recognized, updating the bootloader firmware is essential!</span>Refer to [[How to update eeprom firmware]] to update firmware or [[#FAQ]] Q1 to know more details.

==Flash OS onto NVME SSD==
To get the NVMe SSD to boot your Pi, it needs to have an OS, so the Raspberry Pi OS needs to be flashed onto NVME SSDs, this is very important!


'''Only''' support Raspberry Pi OS ('''Bookworm''') version, Raspberry Pi OS bullseye or Ubuntu or Home Assistant OS is NOT supported, refer to https://www.raspberrypi.com/software/operating-systems/

Here are a few ways to flash the OS to an NVME SSD:


'''1. Use <span class="tb_red">SD Card Copier</span> tool to flash OS onto the NVME SSD On Raspberry Pi OS(<mark>Recommended</mark>)'''

: ''This method works if you have an SD card and have booted the device successfully''

Cick '''Applications''' =>'''Accessories''' =>'''SD Card Copier''' on the main screen, run the '''SD Card Copier''' program, and copy the OS to the NVME ssd as shown in the figure below.

[[File:PI5-sd-copier.png|800px]]
<!--
[[File:Sd-copoer-scrot.png]]
-->

Click '''Start''' to run. Then shut down, unplug the SD card, and restart the device.

<span class="tb_red">This is a visual operation and we highly recommend it!</span>


'''2. Flash the SSD with Raspberry Pi Imager'''

You can also directly use the [https://www.raspberrypi.com/software/ Raspberry Pi Imager] tool on a MAC computer or windows computer to flash a fresh Pi OS to NVME SSD, but you will need an additional USB to nvme adapter.
# Install Pi Imager and open it
# Plug your NVMe SSD into your computer using a USB to NVMe adapter
# Choose an OS to install
# Choose the drive (connected through your adapter) to flash
# Click write (and set any options you'd like)
# Once you have finished flashing the OS, DON'T remove the nvme SSD. You must [[#Enable PCIe]].

Then pull the NVMe drive, attach it to your Pi 5, and it should boot off it (with or without a microSD card inserted)—assuming you have the bootloader up to date and set the '''BOOT_ORDER''' appropriately!

<span class="tb_red">'''NOTE:'''</span>

If you are flashing a fresh Pi OS to NVME ssd, you must [[#Enable PCIe]]; but if you are COPY or CLONE an old Pi OS from SD card to NVME ssd, and you have already enabled pcie in the old Pi OS in advance, then you don't need to do enable pcie again!

==Set NVMe early in the boot order==
The PCIe connection should work after a reboot, but your Pi won't try booting off an NVMe SSD yet. For that, you need to change the '''BOOT_ORDER''' in the Raspberry Pi's bootloader configuration:

* Use tool '''raspi-config''' to set boot order
sudo raspi-config
Then select '''6 Advanced Opitions''' => '''A4 Boot Order''' => '''B2 NVMe/USB Boot''' answer '''Yes''', then <code>sudo reboot</code>
* Run the following command to set boot order.
sudo rpi-eeprom-config --edit
Then change the BOOT_ORDER line to the following:
BOOT_ORDER=0xf416

- Press '''Ctrl-O''', then enter, to write the change to the file.

- Press '''Ctrl-X''' to exit nano (the editor).

Read [https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#BOOT_ORDER Raspberry Pi's documentation on BOOT_ORDER] for all the details. For now, the pertinent bit is the '''6''' at the end: that is what tells the Pi to attempt NVMe boot first!

'''Reboot''' your Raspberry Pi 5 to make the change take effect.

==Decrease wattage when turned off==
By default, the Raspberry Pi 5 consumes around 1W to 1.4W of power when turned off. This can be decreased by manually editing the EEPROM configuration with <mark>'''''sudo rpi-eeprom-config -e'''''</mark>. Change the settings to the following:
BOOT_UART=1
POWER_OFF_ON_HALT=1
BOOT_ORDER=0xf416
Then reboot the device with <mark>'''''sudo reboot'''''</mark>, this should drop the power consumption when powered down to around 0.01W.
==References==
<references />
==FAQ==
{{X100x-FAQ}}

Return to [[X1000]] / [[X1001]] / [[X1002]] / [[X1003]]

<!--Add review function! -->
<comments />

<!--Please choose the -->
<!--Remove other categories, just keep the appropriate categories -->

[[Category:Product Manual]]
[[Category:Raspberry pi]]