Apalis imx6 temperature sensor linux device-tree

Hello,

I have ported my device-trees when upgrading from Board Support Package version 2.8 to version 5. Unfortunately, reading the SoM temperature no longer works since then [1].

The kernel configuration seems to contain all necessary options, it is attached to the post [2].

Which entry do I need to be able to read out the board temperature again under /sys/bus/iio/devices/iio\:device0/in_temp8_input?

Many thanks for your help.

[1] Temperature Sensor (Linux) | Toradex Developer Center
[2] kernelconfig.txt (161.1 KB)

My setup:
Apalis iMX6Q 1GB V1.1Y
Ixora V1.0A (alternatively own carrier boards, all have the same problem)
Yocto BSP 5.7.6

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

To address the issue of reading the SoM temperature on your Apalis iMX6Q after upgrading to BSP version 5, you’ll need to ensure that your device tree is correctly configured to enable the temperature sensor. The temperature sensor on the i.MX 6 series is typically accessed through the Industrial Input/Output (IIO) framework, with readings available under the sysfs path /sys/bus/iio/devices/iio:device0/in_temp8_input.

Here are the steps you can follow:

  1. Verify Device Tree Configuration:

    • Ensure the thermal sensor node is correctly defined in your device tree. Look for a node under the thermal-zones section that references the appropriate sensor. It might look something like this:
      thermal-zones {
          cpu-thermal {
              polling-delay-passive = <1000>;
              polling-delay = <5000>;
              thermal-sensors = <&thermal_sensor>;
              ...
          };
      };
      
    • Make sure the thermal-sensors property points to the correct sensor node.
  2. Check Kernel Configuration:

    • Confirm that the necessary kernel modules for IIO and thermal management are enabled, such as CONFIG_THERMAL and CONFIG_IIO.
  3. Recompile and Deploy:

    • After making changes to the device tree, recompile it and deploy the updated binary to your device.
  4. Test the Temperature Reading:

    • Once the device tree is correctly configured and deployed, check the temperature reading using:
      cat /sys/bus/iio/devices/iio:device0/in_temp8_input
      

If the issue persists, double-check the device tree bindings and ensure all necessary drivers are loaded at boot. This should help restore the temperature reading functionality on your Apalis iMX6Q module.

Best regards,
Toradex AI Assistant

Please, also check if these links can help you solve your problem:

Temperature Sensor (Linux) | Toradex Developer Center.

Hi,

Unfortunately, the answer is very unspecific. I use the device-tree from the ixora board as a template (imx6q-apalis-ixora-v1.1.dts). I cannot find an entry with thermal-zones in it. I include the identicial device-tree-includes (“imx6q.dtsi” and “imx6qdl-apalis.dtsi”).
However, I assume that the temperature measurement works with the ixora board as listed in the description [1]. Can you please help me specifically.

Best regards.

Hi @aweger !

I’ve tested using an Apalis iMX6Q and BSP 7.1.0.

I could read the file and get the temperature, as said in this article:

root@apalis-imx6-05041231:~# cat /sys/bus/iio/devices/iio\:device0/in_temp8_input
37515

Could you test with BSP 7.1.0, please?

Best regards.
Lucas Azeituno.

Hi @lucas_az.tx

Thanks for your time. Unfortunately I can’t try out the new BSP 7. I have been busy for a long time preparing all our services for the Long Term Bsp 5. We have first versions in the field.

Maybe you can have a look at my DeviceTree. I suspect that I have removed something that is necessary for the sensor when porting from BSP 2 to BSP 5. Unfortunately, I can’t find anything plausible.
I would be happy to send you the DeviceTree privately. We can then publish the solution here.

Many thanks for your support.

Hi @aweger !

Have you ever tested with a Toradex reference image? Just to be sure that the sensor is working and it is not a hardware problem. If you haven’t, please test it.

Best regards.
Lucas Azeituno.