Thermal Management
Introduction
Thermal management ensures the system and its components operate within defined temperature ranges for reliable operation. It involves concepts such as power consumption, heat dissipation, and system temperature, which are related to the following topics:
- Hardware: the heat generation is directly proportional to the power consumption of the device. Also, each component has its specific operating temperature ranges and limits. Usually, you are concerned with System on Chip (SoC) heat dissipation and System on Module (SoM) operating temperature ranges. The optimal design of the carrier board may help reduce the power consumption of the system, which may result in a significant heat reduction.
- Software: the power consumption - and thus the heat generation - of the system and its components are affected by the software load put on the hardware components, such as CPU cores, GPU, and peripherals. This software load is directly related to the use-case application but also affected by the Board Support Package (BSP) version and its fine-tuning.
- Enclosure: the mechanical enclosure of the system - a box, for instance - must be taken into account for thermal management. A low-power SoM may fit a constrained enclosure, whereas a high-performance system may require a well-designed airflow or ventilation scheme for proper operation.
- Environment: heat flux intensity depends on a difference of temperature, which here is the difference between the hardware - usually the SoC in this case - and the environment. Knowing the environment temperature range where the system operates is essential for designing a thermal management solution that both satisfies the system requirements and uses the least complex cooling mechanism possible.
This article provides an overview of thermal management solutions applied to Toradex SoMs. It goes through the hardware and software BSP specifics as well as cooling solutions.
Hardware
You can find the maximum junction temperature and operating temperature range specifications in the respective Toradex SoM datasheet, under the Thermal Specification section. The datasheets are available in the corresponding product pages, under the Datasheets tab.
Software and BSP
This section goes through the software and BSP specifics related to thermal management.
Dynamic Voltage and Frequency Scaling (DVFS) and Thermal Throttling
Dynamic Voltage and Frequency Scaling (DVFS) is a mechanism in which the operating system optimizes power consumption by adjusting the CPU clocks and voltage based on demand. A side-effect of power consumption optimization is that the system generates less heat in workloads that do not make full use of the CPU.
Thermal Throttling is a mechanism implemented in the operating system to preserve the integrity of the processor. It reduces the system clock speed when the processor reaches certain temperatures, independent of DVFS.
DVFS is disabled by default on WinCE. See DVFS on Windows Embedded Compact for further information.
DVFS is not available on TI SoCs in the Toradex BSP:
- AM62 and AM62P: Linux scales the CPU frequency, but the core voltage is fixed. Thermal throttling reduces the CPU frequency when the SoC reaches the passive trip point.
- AM69: The CPU runs at a fixed frequency, and no thermal throttling is available. The system shuts down when the SoC reaches the critical trip point. Make sure your cooling solution keeps the SoC below its maximum junction temperature.
CPU Hotplug
See the following articles for detailed information on supported modules:
OS Specific Guidelines
Choose your OS from the following tabs:
- Linux
- WinCE
On Linux, you can disable DVFS and manually set the CPU frequency. See the CPU Frequency (Linux) article.
An application in the userspace can monitor the temperature. How you read the temperature and which sensors are available depend on the module. See the Temperature Sensor (Linux) article and Apalis/Colibri T30 Temperature Monitoring for additional information.
The Linux kernel handles thermal throttling, and the generic Thermal Sysfs API provides access to its settings. The following section includes information about how to set temperature trip points in Linux:
How to Set Temperature Trip Points
There are two temperature trip points commonly used on i.MX SoCs.
- passive: This is the point where Linux starts to throttle the CPU.
- critical: This is the point where Linux shuts itself down to protect the CPU.
Toradex uses the T_junction_max stated in the datasheet for the critical temperature, and sets the passive trip point 10°C lower.
The following patch is a guideline for how to change these trip points for i.MX-based SoCs:
i.MX 6, i.MX 6ULL, and i.MX 7
diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
index 28072a7..591d6be 100644
--- a/drivers/thermal/imx_thermal.c
+++ b/drivers/thermal/imx_thermal.c
@@ -656,10 +656,10 @@ static int imx_get_sensor_data(struct platform_device *pdev)
}
/*
- * Set the critical trip point at 5C under max
+ * Set the critical trip point at max
* Set the passive trip point at 10C under max (can change via Sysfs)
*/
- data->temp_critical = data->temp_max + (1000 * 10);
+ data->temp_critical = data->temp_max;
data->temp_passive = data->temp_max - (1000 * 10);
return 0;
data->temp_max in this driver is used for the T_junction_max that is read out from the fuses.
data->temp_passive and data->temp_critical are the temperatures described earlier that a developer should set with the desired temperature in milli-degree Celsius.
i.MX 8/8X/8M Mini/8M Plus
On i.MX 8 and i.MX 8X, power management and temperature monitoring are handled by the System Controller Firmware (SCFW). On i.MX 8M Mini and i.MX 8M Plus, Linux exposes thermal zones through the thermal framework.
The default critical and passive trip points are defined in the SoC .dtsi file, and the thermal driver is enabled with CONFIG_IMX8MM_THERMAL, which covers both i.MX 8M Mini and i.MX 8M Plus.
You can access the thermal driver through the following interfaces:
/sys/class/thermal/thermal_zoneXfor i.MX 8 and i.MX 8X./sys/class/thermal/thermal_zone0for i.MX 8M Mini./sys/class/thermal/thermal_zoneXfor i.MX 8M Plus.
Inside the preceding directory, there are files named trip_point*. There you can read the type, current temperature, and hysteresis used by those trip points.
If you want to change the trip points, and you are using an i.MX 8M Mini/8M Plus, it requires a deeper understanding of how they are configured by the system. There are two cases:
- The temperature trip points for the thermal zones are edited by U-Boot considering the SoC that was detected at runtime.
- The trip points that are set on the kernel device tree are used by the NXP “wait for cooling” feature in U-Boot. Whenever U-Boot detects that the SoC is too hot, it stops the boot process and waits until the temperature is lower than the thresholds that are defined in the device tree.
U-Boot overwrites the passive and critical trip points in the kernel device tree at boot, based on the SoC temperature grade. To apply custom trip points on every boot, create a systemd service that writes the desired values through sysfs during startup.
How to Set Temperature Trip Points
You can customize DVFS and thermal throttling settings. See the Resource Manager Registry Settings and Apalis/Colibri iMX6 DVFS on Windows Embedded Compact articles. As an alternative to tweaking resources, as well as a means to monitor system frequency and temperature, Toradex provides a software tool named Toradex Task Manager. Notice that DVFS is available from WinCE Image 1.3b4 onwards.
For additional temperature monitoring information, see Apalis/Colibri T30 Temperature Monitoring and SoC Temperature Readout (WinCE).
Tips and Recommendations
This section has some tips on how to save power, which may help reduce heat generation and other aspects of the software that may affect thermal management.
Disable Unused Display Interfaces
Disabling display interfaces your application doesn't use reduces the power draw associated with driving them, which helps reduce heat generation.
- Linux: Display Output, Resolution, and Timings (Linux)
- WinCE: Tegra display driver registry settings
Use a Lower Frequency
Lowering the CPU frequency reduces power consumption and heat generation, at the cost of processing performance. Test the effect on your use case before applying it permanently.
- Linux: CPU Frequency (Linux)
- WinCE: Toradex Task Manager
Avoid Toggling Pins
Make sure none of the pins are unnecessarily toggling, and that all input pins are in a defined state. Unnecessary pin activity increases power consumption and heat generation.
- Linux: GPIO command-line tools and Device Tree Customization
- WinCE: GPIO Config
Use Low Power Modes
Enter Suspend mode during idle time, or switch off the module completely, to reduce power consumption and heat generation when the system is not in active use.
- Linux: Suspend/Resume (Linux)
- WinCE: Toradex WinCE images offer fast boot, in some cases with a boot time of less than 0.5 seconds.
Check CPU Load
Monitor the CPU load to identify unexpectedly high usage. Some easy modifications may help lower the CPU load, for example, using interrupts instead of polling or sleep instead of busy waits.
- Linux: Use tools such as
topandhtopto monitor CPU load. - WinCE: Use Toradex Task Manager to check the CPU load.
Disable Unused Drivers
Disabling drivers you don't use can help reduce power consumption. Measure the effect first, since disabling some drivers may negatively affect power consumption in certain cases.
Measure the system's power consumption before and after making the changes. It helps in getting a better understanding of the power management of the system.
Cooling Solutions
Cooling solutions usually target the SoC and can be either passive or active. Passive means that natural convection transports heat from the surface to the air. Passive cooling includes exposing the SoC to the environment with or without a heatsink. The efficiency of natural convection is dependent on the housings and the environment. This solution has no moving parts and does not produce noise. If the passive cooling is not sufficient, the most common active cooling solution for embedded systems is the use of a DC fan on top of the heatsink, which increases efficiency dramatically.
If a box encloses the hardware, there are two recommended approaches:
- The design of the enclosure should optimize the airflow.
- The enclosure should thermally couple to the SoC.
The temperature inside the enclosure must stay within the SoM operating temperature range.
Before you finalize the enclosure design, test the complete system under worst-case conditions. Stress the CPU cores or run your final application, and measure the SoC junction temperature, the ambient temperature, and the power consumption. For reference measurements under CPU stress, see the power consumption test results for your module.
Toradex offers heatsinks and other thermal accessories for several SoMs. To check which ones are compatible with your module, see the Accessories & Add-ons section on the respective SoM product page. If you design your own carrier board, follow the thermal solution guidelines in the Carrier Board Design Guides.