AnsweredAssumed Answered

iMX287 LRADC internal temperature giving 0 Kelvin

Question asked by Sam Jaeschke on Aug 21, 2018
Latest reply on Aug 23, 2018 by Sam Jaeschke

I'm using Linux 4.8.17 from this commit: GitHub - Freescale/linux-fslc at 35ef7950aaf7caa28afae35160bda0734ecfeba7 

 

My device tree has this:

#include "imx28.dtsi"

&lradc {
   status = "okay";
   fsl,ave-ctrl = <4>;
   fsl,ave-delay = <2>;
   fsl,settling = <10>;
};

 

Using sysfs to access the LRADC's temperature channel:

# cat /sys/devices/soc0/80000000.apb/80040000.apbx/80050000.lradc/iio\:device0/in_temp8_raw
2  

It gives values only -2 to 2 (with multiple runs).

 

The manual has relevant section 38.2.2 Internal Die Temperature Sensing.

https://www.nxp.com/docs/en/reference-manual/MCIMX28RM.pdf 

 

The mxs-lradc driver has code that looks like it matches the manual description quite well.

linux-fslc/mxs-lradc.c at 35ef7950aaf7caa28afae35160bda0734ecfeba7 · Freescale/linux-fslc · GitHub 

 

The sysfs scale is: 0.253000

The sysfs offset is: -1079.644268 (to convert Kelvin to C)

The sysfs raw output multiplied by the scale should be in Kelvin, so it is reading around 0 Kelvin.

It seems like the raw should be reading around 1200 or more: (1200 - 1079.6) * 0.253 = 30.46C, which is low but in the right region.

 

The mxs-lradc driver looks like it is setting the TEMPSENSE flag correctly at the beginning.

Is this a known problem? What might be the cause?

Outcomes