I have some success in stabilizing pcie 3 on cm5.
currently observing however the results are very promising to date
reboots at various battery % successfully
cold boot up from shutdown at various battery % successfully
when the battery % falls below 30%, there are high chances that pcie link learning will fail and goes into initramfs prompt a lot
ymmv because of silicon lottery etc
as follows:
setup initramfs
this is important because if the pcie link fails during boot, initramfs prompt will be there instead of a blank screen and save the trouble to open the back cover to pull the batteries out to reset
from the initramfs prompt type > echo b > /proc/sysrq-trigger
this will be similar to a power cut and restart the uconsole
cmdline.txt
add
pci=pcie_bus_safe pcie_aspm=off nvme_core.default_ps_max_latency_us=2500 or nvme_core.default_ps_max_latency_us=0
2500 is the sweet spot to allow the nvme to have some power saving, 0 will do as well but at a cost of little bit more battery
config.txt
# PCIe x4 controller reset before starting operating system Pi 5 only
pciex4_reset=0
# delay boot for the pcie link to have enough time to learn. 15-25 secs is the range. I choose the longer timing
boot_delay=1 << updated, I got it wrong
# PCIe stability
dtparam=pcie_ssc=off
dtparam=pciex1=on
dtparam=pciex1_gen=3
# Ensures PMIC doesn’t starve the PCIe bus for PCIE 3 only
usb_max_current_enable=1
# Kernel watchdog timeout to ensure system can recover fromOS hamgs or crashes
# after boot process hhas completed
kernel_watchdog_timeout=10
# initramfs boot, disable if kernel updates break the initramfs from sdcard
auto_initramfs=1
EEPROM
# Default BOOT_ORDER for provisioning
# SD → NVMe → USB → Network
BOOT_ORDER=0xf461
# Set USB max current
PSU_MAX_CURRENT=5000
/# Set NVME boot delay
NVME_BOOT_TIMEOUT=5000 << new