Project

General

Profile

Reading Processor Temperatures

The AM57x has multiple temperature sensors for different parts of the processor. These can be monitored to control the CPU fan or shut down the device if temps get to dangerous levels.

Using omapconf

The TI-provided omapconf tool has a shortcut to view the different temperatures quickly. See the example below:

root@mitysom-am57x:~# omapconf show temp
OMAPCONF (rev v1.74-1-g40ab0a2 built Fri Jan 22 21:22:26 UTC 2021)

...

|--------------------------------------------|
| Sensor | Temperature (C) | Temperature (F) |
|--------------------------------------------|
| MPU    | 52              | 125             |
| GPU    | 53              | 127             |
| CORE   | 52              | 125             |
| IVA    | 52              | 125             |
| DSPEVE | 51              | 123             |
|--------------------------------------------|

Using sysfs thermal_zones

The kernel provides the thermal zone subsystem to auto monitor temperature sensors and can take different actions based on configurable thresholds.

The thermal zones are defined in the dra7.dtsi file and a cpu temp alert threshold has been set to 50C in am57xx-mitysom.dtsi to turn on the cpu fan output (J11)

There are 5 thermal zones, listed below:

root@mitysom-am57x:~# tail /sys/class/thermal/thermal_zone*/type
==> /sys/class/thermal/thermal_zone0/type <==
cpu_thermal

==> /sys/class/thermal/thermal_zone1/type <==
gpu_thermal

==> /sys/class/thermal/thermal_zone2/type <==
core_thermal

==> /sys/class/thermal/thermal_zone3/type <==
dspeve_thermal

==> /sys/class/thermal/thermal_zone4/type <==
iva_thermal

You can get the temperatures by reading the temp file in each zone

root@mitysom-am57x:~# tail /sys/class/thermal/thermal_zone*/temp
==> /sys/class/thermal/thermal_zone0/temp <==
52600

==> /sys/class/thermal/thermal_zone1/temp <==
52600

==> /sys/class/thermal/thermal_zone2/temp <==
53000

==> /sys/class/thermal/thermal_zone3/temp <==
52200

==> /sys/class/thermal/thermal_zone4/temp <==
53800

Using standard lm-sensors

The lm-sensors package provides user-space support for hardware monitoring drivers. Many Linux applications use libsensors to detect and read a devices temperature sensors.

  • Attached is a zip file containing the v3.6.0 lm-sensors. They can be installed using the following command:
    lmsensors_3.6.0_armv7at2hf-neon.zip
    root@mitysom-am57x:~# opkg install libsensors5_3.6.0-r0_armv7at2hf-neon.ipk lmsensors-sensord_3.6.0-r0_armv7at2hf-neon.ipk lmsensors-sensors_3.6.0-r0_armv7at2hf-neon.ipk rrdtool_1.7.0-r0_armv7at2hf-neon.ipk
    
  • The sensors command can then be used to show the different hardware sensors on the board.
    root@mitysom-am57x:~# sensors 
    core_thermal-virtual-0
    Adapter: Virtual device
    temp1:        +46.6 C  (crit = +105.0 C)
    
    cpu_thermal-virtual-0
    Adapter: Virtual device
    temp1:        +45.1 C  (crit = +105.0 C)
    
    gpio_fan-isa-0000
    Adapter: ISA adapter
    fan1:        13000 RPM  (min =    0 RPM, max = 13000 RPM)
    
    dspeve_thermal-virtual-0
    Adapter: Virtual device
    temp1:        +44.2 C  (crit = +105.0 C)
    
    gpu_thermal-virtual-0
    Adapter: Virtual device
    temp1:        +46.2 C  (crit = +105.0 C)
    
    ltc2945-i2c-4-6e
    Adapter: OMAP I2C adapter
    in1:           5.00 V  (min =  +0.00 V, max = +102.38 V)
                           (lowest =  +5.00 V, highest =  +5.00 V)
    in2:           1.01 V  (min =  +0.00 V, max =  +2.05 V)
                           (lowest =  +1.01 V, highest =  +1.01 V)
    power1:       39.00 W  (lowest =  25.62 W, highest =  83.12 W)
                           (max =  10.49 kW, min =   0.00 W)
    curr1:         9.38 A  (min =  +0.00 A, max = +102.38 A)
                           (lowest =  +5.12 A, highest = +16.62 A)
    
    iva_thermal-virtual-0
    Adapter: Virtual device
    temp1:        +46.6 C  (crit = +105.0 C)
    

Note: If you only see the "ltc2945-i2c-4-6e" and "gpio_fan-isa-0000" devices. Make sure you compile and run the latest kernel version as of 2022/11/10
A fix was applied in this commit: https://support.criticallink.com/gitweb/?p=processor-sdk-linux.git;a=commit;h=004d7911fbfb19e1503c1d249bb610410d8717cd

Go to top
Add picture from clipboard (Maximum size: 1 GB)