🛠 Surveillance thermique et fréquence : DVFS, seuils et bridage

Raspberry Pi 4 Model B (2019) — Board Sheet · avance · Schéma : IMG-model-4b-avance-2-model4b-surveillance-thermique.svg — Jauge de température du SoC avec seuils 80 et 85 °C, paliers DVFS 1500/1000/750/600 MHz et dissipateur sur le Pi 4B

Objectives

Understand the thermal management of the Pi 4B: the hardware limit is 85°C, ARM throttling occurs strangely between 80 and 85°C, there is no software limit (unlike the 3B+), and the DVFS engine uses steps of 1500/1000/750/600 MHz. You will build a monitor that logs temperature, frequency, and throttling bits.

Hardware

Complete code

#!/usr/bin/env bash
# thermal-log.sh - journalise temperature, frequence DVFS et etat de bridage
while true; do
  T=$(vcgencmd measure_temp | cut -d= -f2)
  F=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq)
  TH=$(vcgencmd get_throttled | cut -d= -f2)
  V=$(vcgencmd pmic_read_adc | grep EXT5V_V | awk '{print $NF}')
  echo "$(date +%T) temp=$T freq=${F}Hz throttled=$TH 5V=${V}"
  sleep 1
done
# Dans un autre terminal, monter en charge :
sudo stress-ng --cpu 4 --timeout 120s
# Decoder get_throttled : bit0 sous-tension, bit2 bridage thermique,
# bit3 frequence sous le max, bit16 sous-tension passee, bit20 bridage passe.

Expected verification

Under stress-ng, the frequency drops in steps (1500 then 1000 MHz) when the temperature approaches 80°C, get_throttled becomes 0x50005 (thermal throttling + frequency capped), then returns to 0x0 upon cooling. EXT5V_V should remain close to 5.0 V.

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials