VF50 internal temperature sensor disturbed by DTB settings

Hi all,

I’m working with a Colibri VF50 module and I have customized the device tree configuration to adapt it for my custom board.
Here are the modification:

  • touchscreen disabled
  • dcu0 disabled
  • backlight disabled
  • spidev driver used for dspi1
  • some gpio added to additionalgpios pinctrl

Now I’ve just discovered that the internal temperature sensors are not working as expected.

With the original Toradex DTB:
cat /sys/bus/iio/devices/iio\:device1/in_temp_input return 45108
So the current temperature in m°C
With my modified DTB:
cat /sys/bus/iio/devices/iio\:device1/in_temp_input return -96195

I can’t see any link between the modifications I have done and the ADC settings.

Regards

Please provide the diff of the changes to the kernel source tree using

git diff

Also the exact software version you are using and preferable a complete kernel log of the failing case (dmesg).

Hi,

I’m using the branch LinuxImageV2.6 of Index of /toradex-bsp-platform.git to build my image with OpenEmbedded.

There are minor kernel modifications (added custom driver on gpio, small i2c patch), but I’m disturbing my system just by using this new dtb attached.link text

Find also attached working(dmesg_ok) and non working (dmesg_ko) logs.link text

Thanks, this information are helpful. I don’t see an obvious issue with your device tree. Your device disables the resistive touchscreen driver, which makes use of the ADC driver too. However, that should not influence temperature reading… I guess it is a bug in the driver, we need to investigate this further.

I tried booting with the dtb you provided, but, could not reproduce the issue here at my end.

root@colibri-vf:~# fw_printenv | grep -i "dboot"
bootcmd=run dboot; run ubiboot; run sdboot; run nfsboot
dboot=tftp 0x82000000 zImage; tftp 0x84000000 custom-dtb.dtb; bootz 0x82000000 - 0x84000000
root@colibri-vf:~# cd /sys/bus/iio/devices/iio:device0
root@colibri-vf:/sys/bus/iio/devices/iio:device0# cat in_temp_input 
42391
root@colibri-vf:/sys/bus/iio/devices/iio:device0# cd ../iio:device1/
root@colibri-vf:/sys/bus/iio/devices/iio:device1# cat in_temp_input 
42391
root@colibri-vf:/sys/bus/iio/devices/iio:device1# uname -a
Linux colibri-vf 4.4.14-00996-g48b201e-dirty #1491 Tue Jul 12 10:47:55 IST 2016 armv7l GNU/Linux
root@colibri-vf:/sys/firmware# cat devicetree/base/vf50-touchscreen/status
disabled

Thank for the try sanchayan.

Two differences I can see:

  • My kernel is 4.4.5-v2.6b1+g88c66ff
  • I have done some minor cleaning in the dts to remove useless parts (I believe …). However a test with the same dts I have shared gives the same bad results.

Maybe I can try to update to kernel 4.4.16. Which branch are you using?

Regards

I am using the device tree file with the 4.4-next branch. However we did not do any changes to the ADC or the VF50 touchscreen driver since 2.6 Beta 1 release, so I believe there should not be much of a difference. However perhaps you can still try with that. If you would like me to try your new dts file again, please do let me know. I can cross check again.

Hi,

If I’m enabling the touchscreen, the internal temperature sensor is working again!

I’m pretty new to kernel and dtb so it is a bit hard to me to figure out where the issue is coming from. I think I could live with the touchscreen enabled as a workaround, but I would like to understand how to have internal temperature without touchscreen enabled.

Is there some test I can do to narrow the issue?
I have tried to:

  • add the touchscreen gpio pinctrl config to the pinctrl_additionalgpio config, withtout success
  • force status = okay on adc_hwmon, without success

Kind regards

Hm, interesting. Can you also try without touchscreen on one of our reference board?

I have tried and here are the results:
Colibri board flashed with my original dtb with the touchscreen disabled

Plugged on my custom board → temperature KO with a fixed value for device 0 and 1: 496195.
Plugged on a reference Iris board → temperature OK with changing values for device 0 and 1: around 44021.

The only difference I can see in the dmesg are the error with rtc-ds1307 that is not connected on my custom board. link text

Hm, this is likely a hardware issue then. Note that since the temperature sensor is part of the ADC, analog ground (AGND) and anlog 3.3V need to be provided. Can you check your design with regards to this?

I will check, but I’m not sure it comes from the hardware as the same custom board is working if the touchscreen is enabled.

I’m not able to identify the AGND and 3V3 analog from the Colibri pinout.

I just know that the VSS_AUDIO (pin 9/11) and VDD_ANALOG (pin 10/12) are not connected on our custom board. All other GND (39/41/83/109/147/181/197/199) and 3V3 (42/84/108/182/148/198/200) are connected.

Yeah sorry, I quoted the wrong signal names (those were the names from the module schematics).

So the signals are named VSS_AUDIO, VDD_ANALOG on the SO-DIMM pinout. Those need to be connected in order to make use of the temperature sensor.

Ok so it seems our board design is not good.

I haven’t seen anything in the specifications about this, so could you clarify following points for Colibri VF50:

  • VSS_AUDIO (pins 9/11). Seems not to be available on VF50. Need to be connected?
  • HEADPHONE_GND (pin 13) is VSS_AUDIO for VF50. Need to be connected to GND.
  • VDD_ANALOG (pins 10/12) have to be connected to 3V3.

Finally, why is it working if touchscreen is enabled?

Thanks

It is very important that the AVDD_AUDIO (pin 10 and 12) are connected to a 3.3V source and the VSS_AUDIO (pin 9 and 11) are connected to GND. Since the internal ADC is powered from this rail, the temperature sensor will not work if the voltage is missing.

The touch screen circuit is also using the ADC pins. If you do not add the AVDD_AUDIO and enable the touch screen, there might be a back feeding that will rise up the AVDD_AUDIO rail a bit. This might be enough to get the ADC somehow running. I doubt that the the temperature read out will be very accurate if the ADC is only feed through a back feeding path.