Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3847

Troubleshooting • Re: Raspberry Pi 5 always boots from NVMe SSD, even with BOOT_ORDER=0xf41

$
0
0
Remove the SD card and set the boot order again.
I haven't tried this yet. So I shutdown the pi with BOOT_ORDER=0xf416, removed the sd card, booting from NVMe only and changed BOOT_ORDER to 0xf41.

Code:

$ lsblkNAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTSnvme0n1     259:0    0 931.5G  0 disk ├─nvme0n1p1 259:1    0   512M  0 part /boot/firmware└─nvme0n1p2 259:2    0   931G  0 part /
Now shutting down again, inserting the sd card, so that NVMe and sd are connected again. Unfortunately, it's still booting from NVMe:

Code:

$ df -h /Filesystem      Size  Used Avail Use% Mounted on/dev/nvme0n1p2  916G  4.7G  865G   1% /
some pcie hats cant be auto-detected by the firmware
so you need a config entry in the rpi-eeprom-config to make it detect the nvme, even with nvme in the boot-order
i forget what the entry is, but it should be in the forum search
It's called PCIE_PROBE=1 and documented here: https://www.raspberrypi.com/documentati ... -from-pcie
According to the docs, it's required for non-HAT+ devices. I already found this before and was a bit confused since some posts said it's required, others won't even mention it. The official documentation don't explain much about this flag. Other sources only shortly write it enables enumeration over the PCIe bus. Which seems confusing to me, since there is only a single PCIe connector. I can only guess that it would be theoretically possible that a PCIe hat itself has another PCIe connector, so that we can connect 2 or more devices using the same port.

So I first tried to boot from NVMe without setting PCIE_PROBE=1 to figure out more and it worked. I don't see how this directly affects booting from SD card. But to be sure, I tried to set PCIE_PROBE=0 in hope it may helps:

Code:

 sudo rpi-eeprom-config -eUpdating bootloader EEPROM image: /lib/firmware/raspberrypi/bootloader-2712/stable/pieeprom-2024-01-22.binconfig_src: blconfig deviceconfig: /tmp/tmpqt4s2rnk/boot.conf################################################################################[all]BOOT_UART=1POWER_OFF_ON_HALT=0BOOT_ORDER=0xf41PCIE_PROBE=0
After rebooting, it has been applied. But the RPI is still booting from NVMe:

Code:

$ rpi-eeprom-config[all]BOOT_UART=1POWER_OFF_ON_HALT=0BOOT_ORDER=0xf41PCIE_PROBE=0$ df -h /Filesystem      Size  Used Avail Use% Mounted on/dev/nvme0n1p2  916G  4.7G  865G   1% /
I read this section of the documentation twice and as I understood them, BOOT_ORDER=0xf41 means: Try sd card first, then alternatively USB storage devices. If both failed, restart. While 0xf416 adds NVMe before them. 0xf416 worked, the pi has booted from NVMe and ignores the (also bootable) sd card. But 0xf41 still result in booting from sd card, even if this boot order doesn't even contain NVMe. I can't see that I missed anything that results in doing something wrong.

I slept over this issue and thought how this could be possible. My guess was that the files may be written in the wrong direction. So I had a look at the mount points again and saw something strange:

Code:

$ lsblkNAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTSmmcblk0     179:0    0  59.5G  0 disk ├─mmcblk0p1 179:1    0   512M  0 part /boot/firmware└─mmcblk0p2 179:2    0    59G  0 part nvme0n1     259:0    0 931.5G  0 disk ├─nvme0n1p1 259:1    0   512M  0 part └─nvme0n1p2 259:2    0   931G  0 part /
The root partition is mounted on the NVMe SSD, but /boot/firmware on the sd card? Yesterday (before trying out the suggestions) this was not the case, I included an lsblk call in my original post:

Code:

$ lsblkNAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTSmmcblk0     179:0    0  59.5G  0 disk ├─mmcblk0p1 179:1    0   512M  0 part └─mmcblk0p2 179:2    0    59G  0 part nvme0n1     259:0    0 931.5G  0 disk ├─nvme0n1p1 259:1    0   512M  0 part /boot/firmware└─nvme0n1p2 259:2    0   931G  0 part /
BOOT_ORDER is written to the firmware, not the OS drive. But before, it's written to /boot/firmware:

Code:

$ sudo rpi-eeprom-config -eUpdating bootloader EEPROM image: /lib/firmware/raspberrypi/bootloader-2712/stable/pieeprom-2024-01-22.bin[...]*** CREATED UPDATE /tmp/tmpg1j7_wom/pieeprom.upd  ***   CURRENT: Mon 22 Jan 14:44:36 UTC 2024 (1705934676)    UPDATE: Mon 22 Jan 14:44:36 UTC 2024 (1705934676)    BOOTFS: /boot/firmware'/tmp/tmp.WHvP1RHcoZ' -> '/boot/firmware/pieeprom.upd'Copying recovery.bin to /boot/firmware for EEPROM update
Is it maybe something like rpi-eeprom-config writes it's config to device A, while it's read from device B during boot? Or even never read, when pending updates are written to device A and the RPI is looking for configuration changes on device B during boot.

I mounted the sd card root partition to have a look in the configuration of the .bin files in /lib/firmware:

Code:

$ sudo mount /dev/mmcblk0p2 /mnt/sd-root/$ find /mnt/sd-root/lib/firmware/raspberrypi/bootloader-2712/stable/ -name '*.bin' -printf '%p\n' -exec sh -c 'rpi-eeprom-config {} | grep BOOT_ORDER' \;/mnt/sd-root/lib/firmware/raspberrypi/bootloader-2712/stable/pieeprom-2023-09-21.binBOOT_ORDER=0xf41/mnt/sd-root/lib/firmware/raspberrypi/bootloader-2712/stable/pieeprom-2023-10-30.binBOOT_ORDER=0xf41/mnt/sd-root/lib/firmware/raspberrypi/bootloader-2712/stable/pieeprom-2023-09-13.binBOOT_ORDER=0xf41/mnt/sd-root/lib/firmware/raspberrypi/bootloader-2712/stable/pieeprom-2023-10-18.binBOOT_ORDER=0xf41/mnt/sd-root/lib/firmware/raspberrypi/bootloader-2712/stable/recovery.binERROR: /mnt/sd-root/lib/firmware/raspberrypi/bootloader-2712/stable/recovery.bin: Expected size 96260 bytes actual size 96260 bytes/mnt/sd-root/lib/firmware/raspberrypi/bootloader-2712/stable/pieeprom-2023-11-20.binBOOT_ORDER=0xf461/mnt/sd-root/lib/firmware/raspberrypi/bootloader-2712/stable/pieeprom-2023-09-28.binBOOT_ORDER=0xf41
The file pieeprom-2024-01-22.bin doesn't exist there, since I checked for firmware upgrades and installed one available at the end of my original post. So this update was applied on the NVMe ssd. I think this leads into another source of error, so that I should re-flash the RPIOS on the card, boot from it and copy the new RPIOS installation to the NVMe SSD to let both know about the updated firmware.

Statistics: Posted by L1nux — Sun Feb 04, 2024 11:15 am



Viewing all articles
Browse latest Browse all 3847

Trending Articles