🛠 Surveillance thermique et fréquence CPU
Objectives
Instrument the ODROID-C4 for 24/7 service: read mainline kernel thermal zones, observe the actual OPP steps of the S905X3 (the SM1 table stops at 1.908 GHz, not the 2.0 GHz marketing figure), tune the governor, and verify the frequency actually reached by your image — some images limit the board to 1.5 GHz by default. Reference power consumption: ≈ 1.8 W at idle, ≈ 3.64 W under CPU stress with the included passive heatsink.
Hardware
- ODROID-C4 with the original passive heatsink (40×32×10 mm), mandatory under load
- Closed case: ensure airflow (the official throttling threshold is not documented)
- Armbian current;
sudo apt install -y linux-cpupower stress-ng - VDDCPU rail: MP8756GD PWM regulator, 0.721–1.022 V — never force an OPP beyond this range without adapting the regulator
Complete code
#!/usr/bin/env bash
# suivi_c4.sh : temperature + frequence, echantillon / 2 s
sudo apt install -y linux-cpupower stress-ng
list { for z in /sys/class/thermal/thermal_zone*/temp; do
printf '%s %d °C\n' "$(dirname $z | xargs basename)" \
$(( $(cat $z) / 1000 )); done; }
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
# -> 1000000 1200000 1404000 1500000 1608000 1704000 1800000 1908000
sudo cpupower frequency-set -g performance
stress-ng --cpu 4 --timeout 120s &
for i in $(seq 1 30); do
list | tr '\n' ' '
echo "| $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq) Hz"
sleep 2
done
wait
cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state # temps par palier
Expected verification
During the 120 s stress test, the current frequency climbs toward the highest available step (1.908 GHz on a full mainline image, 1.5 GHz if the image is limited — the time_in_state file proves this). The temperature rises and then stabilizes with the heatsink; no shutdown or reset occurs. At idle, scaling_cur_freq drops back toward 1.0 GHz with the powersave governor, consistent with the ≈ 1.8 W power envelope measurement.
Common mistakes
- Adding a "2.0 GHz" OPP copied from the internet: mainline OPPs stop at 1.908 GHz @ 950 mV; going beyond this without raising the regulator voltage causes immediate resets.
- Leaving the governor set to
performancein summer inside a closed case: for a silent box,powersave(orschedutil) is sufficient for daily use. - Confusing thermal zones (SoC vs regulator): list
thermal_zone*/typeto identify each sensor. - Testing without a heatsink: the board heats up quickly under multi-core load; passive cooling is the original design intent.
- >
Other tutorials for this board
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash