Open main menu

Changes

NVMe SSD boot with the Raspberry Pi 5

1,632 bytes added, 19 April
no edit summary
{{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.
<span class="tb_red">Most of 5. If your SSD is '''OLD''' and has a '''DOS partition''', delete the DOS partition and repartition the content of this tutorial comes SSD (feedback from Jeffbuyer) 6. Please visit the guide below for specific operations.  '''[PS]'''s blog: 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], Thanks fo Jeff</spanref>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_gen=3
However, we '''DON'T''' recommend you to use <span class="tb_red_bold">WARNING:</span><span class="tb_red">The Raspberry Pi 5 is not certified for Gen 3.0 as it is not officially supported speeds, and connections to PCIe devices at these speeds may not work stablybe unstable.</span>
Then DON'T forgot to 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
<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:
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>
# Choose the drive (connected through your adapter) to flash
# Click write (and set any options you'd like)
# Once you have finished flashing is completethe OS, pull DON'T remove the NVMe drive, attach it nvme SSD. You need to your Pi 5, and it should boot off it (with or without a microSD card inserted)—assuming you have change the config.txt in the root directory of the bootloader up NVME SSD drive to date and set the '''BOOT_ORDERenable pcie'''(<span class="tb_blue">edit config.txt and add ' appropriately!dtparam=pciex1'</span> on the end of file), this is very important and too many people forget this.
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 have to must [[#Enable PCIe]] after booting the device; 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-configThen select '''6 Advanced Opitions''' => '''A4 Boot Order''' => '''B2 NVMe/USB Boot''' answer '''Yes''', then <code>sudo reboot</code>* Run the following command to edit the EEPROM on the Raspberry Pi 5set boot order.
sudo rpi-eeprom-config --edit
Then change the BOOT_ORDER line to the following:
'''Reboot''' your Raspberry Pi 5 to make the change take effect.
==Upgrade eeprom, solve NO wifi issueDecrease wattage when turned off=='''NOTE''': If you find that there is no WIFI after restartingBy default, you can try this part the Raspberry Pi 5 consumes around 1W to 1.4W of the update, otherwise please ignore itpower when turned offAfter modifying This can be decreased by manually editing the EEPROM configuration with <mark>'''BOOT_ORDER''' for NVME SSD, reboot the PI5 and you will get the sudo rpi-eeprom-config -e'''NO WIFI''' error</mark>. We need to upgrade the eeprom to fix it (Raspberry Pi Foundation official may upgrade Change the OS to solve this kind of problem, please pay attention settings to the update of Raspberry Pi OS, if the OS upgrade can solve this problem, you can ignore this step). Run the following command to : wget https://github.com/timg236/rpi-eeprom/raw/pieeprom-2023-10-30-2712/firmware-2712/default/pieeprom-2023-10-30.bin BOOT_UART=1 sudo rpi-eeprom-config --edit pieeprom-2023-10-30.binPOWER_OFF_ON_HALT=1 BOOT_ORDER=0xf416[[File:Update-eeprom.png]]  It is recommended to use the latest version of the pieeprom-xxxx-xx-xx.bin file, please visit [https://github.com/timg236/rpi-eeprom/tree/master/firmware-2712/default this link] to get Then reboot the latest version:  device with <mark>'''PS''sudo reboot': After our testing, we found that only the firmware '''piepprom-2023-10-30.bin''' has solved </mark>, this should drop the NO WIFI problem for the time beingpower consumption when powered down to around 0.01W.==References==<references />
==FAQ==
Q: Can't boot from NVME SSD A:  :#Make sure your physical connections are tight.:#An Pi OS is required for the NVME ssd to work for boot, DON'T forget Flash OS onto NVME SSD:#If you're flashing a fresh PI OS , DON'T forget to ENABLE PCIE.(Many people will forget this){{X100x-FAQ}}
Return to [[X1000]] / [[X1001]] / [[X1000X1002]] / [[X1003]]
<!--Add review function! -->