The STM STM32MP13 SOC temperature monitor module features alarm functions that can trigger independent interrupt signals if the temperature rises above a high-temperature threshold or falls below a low-temperature threshold. The temperature threshold is programmable through the device tree.
Kernel configuration
You can manage the thermal support through the kernel configuration option:
-
Temperature sensor STMicroelectronics STM32 support (
CONFIG_STM32_THERMAL
)
This option is enabled as built-in on the default ConnectCore MP13 kernel configuration file.
Kernel driver
File | Description |
---|---|
STM32 Thermal driver |
Device tree bindings and customization
The STM32MP13 thermal device tree binding is documented at Documentation/devicetree/bindings/thermal/st,stm32-thermal.yaml
Definition of the thermal monitor unit
dts: thermal@50028000 {
compatible = "st,stm32-thermal";
reg = <0x50028000 0x100>;
interrupts = <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&rcc TMPSENS>;
clock-names = "pclk";
#thermal-sensor-cells = <0>;
status = "disabled";
};
Usage
CPU temperature
To check the current temperature of the CPU:
# cat /sys/class/thermal/thermal_zone0/temp
49801
The command returns the temperature in millicelsius.
Trip points
A trip point describes a point in the temperature domain at which the system takes an action. This node describes just the point, not the action.
The Linux thermal subsystem establishes several types of trip points:
-
passive: a trip point to enable passive cooling (such as decreasing clock frequency).
-
active: a trip point to enable active cooling (such as activating fans).
-
hot: a trip point to indicate that an emergency temperature threshold has been reached.
-
critical: a trip point where hardware is at risk.
The ConnectCore MP13 device tree defines the following trip points:
Trip point type | Temperature | Hysteresys |
---|---|---|
Passive |
100 °C |
10 °C |
Critical |
110 °C |
1 °C |
These trip points have been determined on the ConnectCore MP13 Development Kit to guarantee safe operation of the SoM within its thermal specification limits. Digi recommends you characterize the thermal behavior of your custom design, and adjust the trip points accordingly. |
Passive trip point
When the temperature in the SOC reaches the passive trip point temperature, the SOC generates an interrupt and the driver sends a notification. Other drivers may subscribe to such notifications in order to trigger cooling actions, such as reducing their clock frequency.
Besides subscriptions, devices declared on the device tree as cooling devices and linked to this trip point will take passive actions.
The device tree only defines one frequency for the CPU, so the cores frequency is not reduced when the SoC temperature reaches the passive trip point. |
The device tree defines a hysteresis of 10 °C for the passive trip point. This means that only when the die temperature has gone 10 °C below the passive trip point, the system is considered within normal parameters and the cooling actions can be cancelled.
To read the passive trip point parameters:
# cat /sys/class/thermal/thermal_zone0/trip_point_0_type
passive
# cat /sys/class/thermal/thermal_zone0/trip_point_0_hyst
10000
# cat /sys/class/thermal/thermal_zone0/trip_point_0_temp
100000
To set a different temperature for the passive trip point, write the new temperature (in millicelsius) to the trip point temperature descriptor:
# echo 65000 > /sys/class/thermal/thermal_zone0/trip_point_0_temp
Trip point changes made through the sysfs are not persistent across reboots. To make permanent changes, modify trip point temperatures on the device tree. |
Critical trip point
When the SOC temperature reaches the critical trip point temperature, the SOC generates an interrupt and the driver resets the system to prevent damage to the silicon.
To read the critical trip point parameters:
# cat /sys/class/thermal/thermal_zone0/trip_point_1_type
critical
# cat /sys/class/thermal/thermal_zone0/trip_point_1_temp
110000
To set a different temperature for the critical trip point, write the new temperature (in millicelsius) to the trip point temperature descriptor:
# echo 90000 > /sys/class/thermal/thermal_zone0/trip_point_1_temp
Trip point changes made through the sysfs are not persistent across reboots. To make permanent changes, modify trip point temperatures on the device tree. |