System corruption on shutdown (CM5 Lite + microSD)

Hi everyone,

I’m experiencing frequent system corruption issues on my uConsole and could use some advice or insights. Thanks in advance.

My Setup:

Hardware:

  • Raspberry Pi CM5 Lite CM5116000 (16GB RAM)
  • SanDisk Extreme PRO microSDXC UHS-I 512GB
  • Samsung INR18650-35E Li-Ion 3.6V 3450mAh
  • Anker Prime Power Bank 12000mAh 130W (Output: 5V⎓3A / 9V⎓3A / 10V⎓2.25A / 10V⎓6.5A / 20V⎓3.25A)
  • UGREEN 240W USB-C to USB-C PD 3.1 Cable
  • UGREEN 100W USB-C to USB-C PD 3.0 Cable

Software:

  • OS: ClockworkPi-Bookworm-lite-6.12.34 by Rex
  • DE: XFCE

My Problem:

I’ve encountered more than 3 times of boot failures already.

The first few seem likely caused by low battery during system write operations (e.g., installing packages or writing some configuration changes), which damaged the filesystem beyond recovery.

The last one, however, was confusing. I was running XFCE, just casually using Chromium, and had installed some fonts. The system was idle and everything appeared stable. This time, I made sure it was connected to a solid Anker power bank, and the battery level was always at 100%, charging throughout. I shut down the system using sudo shutdown -h now from a SSH session, and afterwards, the device never booted again. The power LED turns green, but the screen remains blank. I had to open the back lid and disconnect the battery.

My other tweaks:

To improve resilience, I even added commit=30 to the root ext4 mount:

# Backup original fstab
sudo cp /etc/fstab /etc/fstab.bak

# Add `commit=30` to the root (/) ext4 mount options if not already present
sudo sed -i '/^[^#].*\s\/\s\+ext4/ {
  /commit=30/! s/\<defaults\>\([^,]*\)\(,[^ ]*\)*/defaults\1\2,commit=30/
}' /etc/fstab

# Reboot to apply changes
sudo reboot

# Verify that the parameter has taken effect
mount | grep " on / "

Even with this precaution, and a stable power source, and no heavy I/O going on, the issue happened again.

I honestly don’t understand what went wrong.

Question:

Is the CM5 Lite + microSD setup inherently this fragile? The microSD from SanDisk Extreme PRO is already a high-end product from the market, and I never had any problem using it with my Steam Deck or ASUS ROG Ally X, how come it’s so problematic here?

Would switching to a CM5 with eMMC significantly reduce the risk of corruption, because of better hardware-level write caching and power-loss tolerance?

Seriously, I’m exhausted from reflashing and reconfiguring everything over and over again. I really just want to enjoy using my uConsole, not constantly recovering it.

I’d appreciate any help, suggestions, or shared experiences! :folded_hands:

Are you sure the SD is getting corrupted?
Have you edited the EEPROM of the CM5?

Hey Rex, thanks so much for helping out, and also big thanks for your awesome image!

I’m not 100% sure if the SD card itself is actually getting corrupted, but every time I reflash the image, the system boots up and works fine again. So something definitely breaks in a way that prevents booting. And the first few times indeed the battery ran out when I was operating some write changes.

I haven’t touched or modified the CM5’s EEPROM at all. Just some standard OS-level tweaks.

for best results with the cm5 lite follow the if you have a cm5 lite part of the first post.

it will most likely fix your issue.

Ah, true, I read your post and I didn’t have chance to update CM5’s firmware yet. I’ll try it out and post the update here. Thanks Rex!

1 Like

Update:

I’ve checked that I have already had the latest EEPROM firmware, so I didn’t/couldn’t update.

$ vcgencmd version
2025/05/08 15:13:17
Copyright (c) 2012 Broadcom
version 69471177 (release) (embedded)

$ vcgencmd bootloader_version
2025/05/08 15:13:17
version 69471177ba7e4cb7597cb2496f2a0b23f19c1113 (release)
timestamp 1746713597
update-time 1750730730
capabilities 0x0000007f

$ sudo rpi-eeprom-update
BOOTLOADER: up to date
   CURRENT: Thu  8 May 14:13:17 UTC 2025 (1746713597)
    LATEST: Thu  8 May 14:13:17 UTC 2025 (1746713597)
   RELEASE: default (/usr/lib/firmware/raspberrypi/bootloader-2712/default)
            Use raspi-config to change the release.

But I followed Rex’s instruction and updated the EEPROM configuration:

[all]
BOOT_UART=1

# Switch off PMIC outputs on HALT
POWER_OFF_ON_HALT=1

# Try boot on SDCard repeatedly
BOOT_ORDER=0xf1
SD_BOOT_MAX_RETRIES=2

# Slow down SDCard SDR Mode on bootloader
SD_QUIRKS=1

Since then I’ve triggered shutdown/reboot a few times (playing 4k YouTube videos and doing other stuff), and the system is fine. May the stability be with me :crossed_fingers:

Thanks Rex!

3 Likes