This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/TMDX654IDKEVM: Temperature reading

Part Number: TMDX654IDKEVM

Tool/software: Linux

Hello,

I was able to read temperature of the SOC in linux from /sys/class/thermal/thermal_zone*/temp.

Is any rule to convert that value in a physical temperature? I assume  that this value is divided by 1000 but I observed that the value is fluctuating by 2-3 degrees every 1 second since we are not running any complex app on the cores.

Best regards!

  • Hi Silviu,

    From what I am able to find, the "temp" value should be in milliCelsius.

    am654-industrial-thermal.dtsi

    mpu0_thermal: mpu0_thermal {
        polling-delay-passive = <250>; /* milliseconds */
        polling-delay = <500>; /* milliseconds */
        thermal-sensors = <&wkup_vtm0 0>;

        trips {
            mpu0_crit: mpu0_crit {
                temperature = <125000>; /* milliCelsius */
                hysteresis = <2000>; /* milliCelsius */
                type = "critical";
            };
        };
    };

    The temp value is converted from ADC read value (from bandgap sensor) to milliCelsius.

    Refer to below files for more info:

    linux-kernel/Documentation/devicetree/bindings/thermal/thermal.txt

    linux-kernel/include/linux/thermal.h

    linux-kernel/Documentation/devicetree/bindings/thermal/ti_k3_thermal.txt

    linux-kernel/drivers/thermal/k3_bandgap.c

    linux-kernel/drivers/thermal/ti-soc-thermal/ti-bandgap.c

     

    Regards,
    Pavel