🛠 Surveiller température et bridage : le BCM2835 à l'épreuve

Raspberry Pi Model B+ (2014) — Board Sheet · avance · Schéma : IMG-model-b-plus-avance-2-modelbp-surveillance-thermique.svg — Raspberry Pi Model B+ avec son SoC BCM2835 souligné, sonde de température et jauges fréquence 700 MHz / seuil de bridage 85 °C, un graphique température-temps en encart et l'éclair de sous-tension.

Objectives

Set up continuous monitoring of the SoC: temperature, actual frequency, and especially the firmware throttling register, which also signals undervoltage. The BCM2835 on the Model B+ is clocked at 700 MHz, and the firmware throttles above 85 °C or in case of insufficient power supply — learn to detect this before shutdowns occur.

Hardware

Full code

# Lecture ponctuelle
cat /sys/class/thermal/thermal_zone0/temp   # milli-°C
vcgencmd measure_temp                       # °C format humain
vcgencmd measure_clock arm                  # fréquence courante (Hz)
vcgencmd get_throttled                      # 0x0 = rien à signaler
# Interprétation de get_throttled (masques) :
#  bit0 sous-tension | bit3 bridage sous-température | bit5 bridage fréquence
#  bit6 bridage sous-tension | bits 16-19 = événements passés depuis le boot
# Journal de surveillance toutes les 30 s, 24 h
timeout 86400 sh -c 'while :; do
  echo "$(date -Is) $(cat /sys/class/thermal/thermal_zone0/temp) $(vcgencmd measure_clock arm | cut -d= -f2) $(vcgencmd get_throttled | cut -d= -f2)"
  sleep 30
done' > /var/log/thermal.csv
# Charge de test dans un autre terminal
yes > /dev/null &   # puis tuer : kill %1

Expected verification

At idle, the sensor typically stays below 50 °C and get_throttled returns 0x0. Under yes, the temperature rises towards the 85 °C threshold, and measure_clock may drop below 700 MHz with the throttling bit set. A value of 0x50000 or 0x50005 indicates undervoltage: the problem is the power supply, not cooling.

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials