iMX8MM temperature sensor gives unconsistent values

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

iMX8MM temperature sensor gives unconsistent values

跳至解决方案
1,419 次查看
Gerome
Contributor II

When doing some temperature measurement on our devices, we observed that the temperature given by the imx8mm (`cat /sys/class/thermal/thermal_zone0/temp`) can greatly fluctuate from one device to the other, with the exact same Linux image running.

We also measured the chip temperature with an IR camera and observed that we saw that the difference between imx sensor and the camera can go up to 20°C !

We verified that the imx8mm_thermal driver is included in our kernel.

What can be the reason of these huge temperature differences ?
Maybe there is an issue with the hardware sensor calibration ?

 

 

标签 (2)
1 解答
665 次查看
Gerome
Contributor II

Talking to NXP's support, they said that this bug has been reported before and that this was fixed in the BSP version 5.15.32.

They also said that it should be safe, as a workaround, to read TSCR and TE1 and recalculate the calibrated value (that should be the same as reading TRISRT register).

在原帖中查看解决方案

0 项奖励
回复
9 回复数
666 次查看
Gerome
Contributor II

Talking to NXP's support, they said that this bug has been reported before and that this was fixed in the BSP version 5.15.32.

They also said that it should be safe, as a workaround, to read TSCR and TE1 and recalculate the calibrated value (that should be the same as reading TRISRT register).

0 项奖励
回复
663 次查看
Gerome
Contributor II
We could not update our BSP so we did not validate the first solution.
But the workaround is working fine for us.

Thanks
0 项奖励
回复
1,075 次查看
Gerome
Contributor II

Hi @Alejandro_Salas,

 

It seems that burning the fuses when we are locking the device creates this temperature error !

Is there a potential side effect ?

Is it possible that writing some values in the OTP breaks the TMU ?

As a workaround, is it safe to read TSCR in the driver and calculate the calibration ourselves based on TE1 ?

 

Thank you,

Gerome

0 项奖励
回复
1,215 次查看
Gerome
Contributor II

We made some further investigations and tried to read the value in register TMU_TSCR, which should contain the direct sensor value without 1 point calibration Tsense (?).

And we saw that when we apply the 1 point calibration formula

         Tcalib = Tsense - (TE1 - 25)

<=>   Tcalib = TSCR - (TE1 - 25)

to the value in TSCR, we have completely different value from the TMU_TRITSR register !

On 3 different devices under different conditions, in °C:

Tcalib ( = TSCR - (TE1 - 25) )
TRISTR
5974
5059
5578

 

Is there something wrong with our calculation ?

Is it possible that some kernel configuration breaks TRISTR hardware calibration ?

@Alejandro_Salas 

 

Thank you for your time

Gerome

0 项奖励
回复
1,404 次查看
Alejandro_Salas
NXP TechSupport
NXP TechSupport

Hello @Gerome ,

 

Could you please share the below details:

 

Are you using a custom board or EVK?

What BSP version are you using?

 

Thank you.

Best regards.

 

Salas.

 

 

0 项奖励
回复
1,369 次查看
Gerome
Contributor II

Hello @Alejandro_Salas ,

I am using a custom board and the manifest imx-5.4.70-2.3.2.xml, it is a bit old but I didn't see any relevant commits on temperature since then.

Thanks

Gerome

0 项奖励
回复
1,350 次查看
Alejandro_Salas
NXP TechSupport
NXP TechSupport

Hello @Gerome ,

 

Could you please check your VDD_SOC, VDD_ANA0_1P8, and VDD_ANA0_0P8 power rails.

 

That power rails impact directly to sensor. You can refer to EVK Schematics.

 

Best regards!

 

Salas.

1,231 次查看
Gerome
Contributor II

Hello @Alejandro_Salas ,

 

We also checked that a 100k resistor is connected to J24, so this is not the issue either.

Can you confirm that the temperature read from the imx8mm thermal driver includes the 1 point calibration (so the DC offset is already subtracted from the value) ? Because the problem we have looks like an offset compensation error.

Do you have any other ideas on what could cause this problem ?

 

Thank you again for your help

Gerome

0 项奖励
回复
1,287 次查看
Gerome
Contributor II

Hi,

Thanks for your reply!

We just checked, we have VDD_SOC = VDD_ANA0_0P8 = 849mV, and VDD_ANA0_1P8 = 1.78V.
Measures are pretty similar across the different boards (even the ones that have a big thermal sensor difference)

Regards,

Gerome

0 项奖励
回复