Imx6ul CPU Temp Sense: Difference between revisions

From embeddedTS Manuals
(Initial creation)
(Lowered heading number for these sections. Removed generic header, going to rename this page.)
Line 1: Line 1:
{{Note|The current latest image, 20191122, does not support either method of temperature sensing discussed below. Support for these have been added to the kernel after the image release, and can be enabled by [[#Compile_the_Kernel|compiling the kernel from source]]}}
==== ADC ====
 
=== ADC ===


The i.MX6UL Low Resolution ADC (LRADC) has an internal temperature sensing channel for monitoring die temperatures. This temperature sensor is likely implemented internally as a diode based sensor. The status of the temperature sensor can be read through the [https://www.kernel.org/doc/html/v4.14/driver-api/iio/index.html Linux Industrial I/O Subsystem] (IIO), which provides the simplest API via [https://en.wikipedia.org/wiki/Sysfs sysfs] (/sys) The following command returns temperature in millicelsius:
The i.MX6UL Low Resolution ADC (LRADC) has an internal temperature sensing channel for monitoring die temperatures. This temperature sensor is likely implemented internally as a diode based sensor. The status of the temperature sensor can be read through the [https://www.kernel.org/doc/html/v4.14/driver-api/iio/index.html Linux Industrial I/O Subsystem] (IIO), which provides the simplest API via [https://en.wikipedia.org/wiki/Sysfs sysfs] (/sys) The following command returns temperature in millicelsius:
Line 8: Line 6:
</source>
</source>


=== Thermal Zone ===
==== Thermal Zone ====


The i.MX6UL CPU has an internal TEMPMON peripheral that is supported by [https://www.kernel.org/doc/html/latest/driver-api/thermal/sysfs-api.html Linux's Thermal Zone management]. This sensor is embedded more toward the center of the die and therefore reads hotter than its ADC counterpart as it is meant to be reflective of the thermal state of the CPU for throttling control. This can be read similarly to the ADC counterpart above using [https://en.wikipedia.org/wiki/Sysfs sysfs] (/sys). The following command returns the temperature in millicelsius:
The i.MX6UL CPU has an internal TEMPMON peripheral that is supported by [https://www.kernel.org/doc/html/latest/driver-api/thermal/sysfs-api.html Linux's Thermal Zone management]. This sensor is embedded more toward the center of the die and therefore reads hotter than its ADC counterpart as it is meant to be reflective of the thermal state of the CPU for throttling control. This can be read similarly to the ADC counterpart above using [https://en.wikipedia.org/wiki/Sysfs sysfs] (/sys). The following command returns the temperature in millicelsius:

Revision as of 14:31, 30 December 2020

ADC

The i.MX6UL Low Resolution ADC (LRADC) has an internal temperature sensing channel for monitoring die temperatures. This temperature sensor is likely implemented internally as a diode based sensor. The status of the temperature sensor can be read through the Linux Industrial I/O Subsystem (IIO), which provides the simplest API via sysfs (/sys) The following command returns temperature in millicelsius:

cat /sys/bus/iio/devices/iio:device0/in_temp_input

Thermal Zone

The i.MX6UL CPU has an internal TEMPMON peripheral that is supported by Linux's Thermal Zone management. This sensor is embedded more toward the center of the die and therefore reads hotter than its ADC counterpart as it is meant to be reflective of the thermal state of the CPU for throttling control. This can be read similarly to the ADC counterpart above using sysfs (/sys). The following command returns the temperature in millicelsius:

cat /sys/class/thermal/thermal_zone0/temp