Raspberry Pi
Freezing
System stability with the Raspberry Pi has been a struggle for me. It can really ruin the fun of discovering microcontrollers/SBCs if you're constantly reflashing SDs and swapping power supplies.
Once in a while, pretty much anyone who tinkers with the Raspberry Pi may find that their system starts freezing up. It can be a total nightmare to debug. If you're dealing with this, first of all— you have my sympathies.
Now, let's get down to brass tacks and figure out what's causing this issue. A raspberry pi that is suddenly locking up and requires a hard reboot (power cycle), usually suffers from one of the following issues:
Power
Make sure you have an officially-supported power supply. A good one for the Raspberry Pi 4 (where I most often encounter this problem) needs to have 5V and at least 3A of current.
I had a CanaKit PSU that was within this range, but ended up being the smoking gun. I tried reflashing the OS on a new microSD, disconnecting peripherals, ensuring swap was enabled, removing all overclocking, and I was still having power issues.
After switching to a backup PSU (also rated at 5V3A), the RPi stopped experiencing the random freezes. There had been some thunder storms recently, so maybe a power surge damaged the original. I really don't know.
If you have other peripherals (like a shield, USB devices, etc.), try disconnecting them and using the Pi for a while. If you're on a circuit in your house with other power-hungry devices, try moving the Pi to another plug.
Temperature
If an RPi gets past a certain temperature limit, it might freeze up and require a power cycle— which could potentially corrupt your microSD card! If your pi boots at all, look at the temperature:
# CPU Temperature
# This returns the temperature in millidegrees Celsius (e.g., `54000` = 54.0°C)
cat /sys/class/thermal/thermal_zone0/temp
# To get a human-readable format:
awk '{printf "CPU Temp: %.1f°C\n", $1/1000}' /sys/class/thermal/thermal_zone0/temp
# GPU Temperature:
# This outputs something like `temp=54.0'C`
vcgencmd measure_temp
# Both together (quick alias idea):
echo "GPU: $(vcgencmd measure_temp)" && echo "CPU: $(awk '{printf "%.1f°C", $1/1000}' /sys/class/thermal/thermal_zone0/temp)"If your temperature is consistently spiking above 70 or 80°C, you might consider a better cooling solution— make sure you have a solid thermal connection with any heatsinks, try adding a fan or larger heatsink. Ensure that your pi isn't closed off from ambient airflow (like in a sealed enclosure).
CPU/GPU Overclocking
This is an easy one to debug, because you can just remove the overclocking from you /boot/config.txt and see if the lock-up occurs. Often, this issue piggybacks on temperature/power issues.
To check and ensure your Raspberry Pi has no overclocking settings, inspect the boot configuration file:
cat /boot/config.txt
# or on newer Raspberry Pi OS versions:
cat /boot/firmware/config.txtarm_boost # Set to 0 to disable
arm_freq # CPU frequency (default varies by model, 1.5GHz on RPi4)
gpu_freq # GPU frequency (default varies by model, 500MHz on RPi4)
core_freq # Core frequency
sdram_freq # SDRAM frequency
over_voltage # CPU/GPU voltage adjustment
over_voltage_sdram # SDRAM voltage
force_turbo # Forces max frequency at all timesIf any of these are present and set above default values, the Pi is overclocked. To remove overclocking, comment them out with # or delete those lines entirely.
Unsupported GPU Drivers
One of my Raspberry Pi SBCs has EndeavourOS
installed. This is an awesome option if you want an easy Arch Linux install on the Pi. I don't know if it's documented, but I kept seeing system lock-ups when the RPi's v3d kernel module (VideoCore VI 3D acceleration driver) was enabled. It could be unrelated to the OS, but here were the symptoms:
- Random system freezes/lockups requiring hard power cycles
- No kernel panic, no errors on screen— just an unresponsive system
- Progressively shorter uptimes (perhaps under a faulty PSU... after replacement, less frequent, but still happening)
- Corruption on boot partition (
journal uncleanly shut down)
Root Causes
The v3d kernel module has a bug in the DRM GPU scheduler on kernel 6.18.18. The failure sequence:
- A GPU bin job hangs
- The timeout handler fires:
v3d_bin_job_timedout - It calls
v3d_gpu_reset_for_timeout->drm_sched_stop drm_sched_stopcallsdma_fence_wait_timeouton a fence that never signals- The kernel worker thread enters unintentionally sleep (D state) permanently
- Repeated GPU resets flood the scheduler, cascading into a full system lockup
- No panic or oops is logged— the system simply becomes unresponsive
This occurs regardless of the display overlay (both vc4-kms-v3d and vc4-fkms-v3d), because v3d module loads independently for 3D acceleration.
Key log evidence
kernel: v3d fec00000.v3d: [drm:v3d_reset v3d] ERROR Resetting GPU for hang.
kernel: v3d fec00000.v3d: [drm:v3d_reset v3d] ERROR V3D_ERR_STAT: 0x00001000
kernel: v3d fec00000.v3d: MMU error from client L2T (13) at 0x200, pte invalid
kernel: INFO: task kworker/1:3:25194 blocked for more than 120 seconds.
kernel: Workqueue: events drm_sched_job_timedout gpu_sched
kernel: Call trace:
dms_fence_default_wait
dms_fence_wait_timeout
drm_sched_stop gpu_sched
v3d_gpu_reset_for_timeout v3d
v3d_bin_job_timedout v3d
drm_sched_job_timedout gpu_sched
Fixes
- Blacklist v3d module (primary fix)
blacklist v3d
blacklist gpu_schedThen rebuild initramfs:
sudo mkinitcpio -PYou will have no hardware OpenGL/3D acceleration. Desktop, VNC, 2D, and video playback all work fine via vc4 FKMS
- Switch display overlay to FKMS
dtoverlay=vc4-fkms-v3dThis uses the firmware-backed display path instead of full KMS (Kernel Mode Setting).
- Enable hardware watchdog
[Manager]
RuntimeWatchdogSec=15
WatchdogDevice=/dev/watchdog
RebootWatchdogSec=2minAlso, in /boot/config.txt:
dtparam=watchdog=on- Fix fstab for automatic
fsck
UUID=A4C6-A593 /boot vfat defaults 0 2
UUID=5e1cff67-6a84-4e49-b936-503c8bc142d9 / ext4 defaults 0 1The root partition was missing from fstab entirely, and the boot partition had pass 0 (no fsck). Now both are checked automatically on boot.
Diagnostic Tools
vcgencmd get_throttleddmesg | grep -iE "v3d|gpu.*reset|hang"
journalctl -b 1 -p errjournalctl -b 1 | grep "blocked for more than"journalctl --list-bootsdmesg | grep -iE "corrupt|unclean|fsck"cat /sys/block/mmcblk0/device/life_time
cat /sys/block/mmcblk0/device/pre_eol_info
VNC
Remmina
Taken from the "Linux Consulting and Training" docs:
Tested with Raspberry Pi OS on July 2020
When trying to connect from your Linux machine using Remmina to a Raspberry Pi running Raspberry PI OS with RealVNC enabled you get the error:
Unknown authentication scheme from VNC server
RealVNC only supports a few security schemes. Authentication=VncAuth seems to be the only scheme that allows direct connections from VNC-compatible Viewer projects from third parties. In order to change to VncAuth scheme in your Raspbian and set a password to accept connections from Remmina VNC plugin, open a SSH session (or a terminal window) on the Raspberry and generate your VNC password with:
sudo vncpasswd -serviceNow, edit the file /root/.vnc/config.d/vncserver-x11
sudo nano /root/.vnc/config.d/vncserver-x11and add the following line at the end of the file:
Authentication=VncAuthNow your config file should look more or less like mine:
_AnlLastConnTime=int64:0000000000000000
_LastUpdateCheckSuccessTime=int64:01d65c12272dff1a
_LastUpdateCheckTime=int64:01d65c12272dff1a
Password=c3abbea3b003a0b231737c0541892d72
Authentication=VncAuthc3abbea3b003a0b231737c0541892d72 is the encrypted version of "raspberry"; your line will likely be different.
Eventually, restart the VNC server service with:
sudo systemctl restart vncserver-x11-serviced...and you are ready to connect to your Raspberry Pi using Remmina.
Imager
How do I open "Advanced Settings" in Raspberry Pi Imager application?
- Hold
Ctrl+Shift+xon the main Imager screen

