Hi,
I’m running a program that is retrieving the raw ADC counts of ADC2 and ADC3 regularly using userspace (/sys/bus/iio/devices/iio:device0).
This seems to be working just fine for the first few hours and the files “in_voltage6_raw” and “in_voltage7_raw” nicely represent the correct values.
After about 13 hours though, it seems like the channels get swapped and when retrieving the value from “in_voltage6_raw” I am actually reading the value that I would expect from “in_voltage7_raw” and the other way around.
It seems like these channels get swapped for some reason.
After rebooting the entire OS, the problem is gone and I can retrieve the correct values from the correct files again.
Here is some serial output that visualizes this issue:
ge7_raw ibri-imx6:/sys/bus/iio/devices/iio:device0# cat in_voltage6_raw in_voltag
2047
0
ge7_raw ibri-imx6:/sys/bus/iio/devices/iio:device0# cat in_voltage6_raw in_voltag
2049
0
ge7_raw ibri-imx6:/sys/bus/iio/devices/iio:device0# cat in_voltage6_raw in_voltag
2047
0
ge7_raw ibri-imx6:/sys/bus/iio/devices/iio:device0# cat in_voltage6_raw in_voltag
2045
0
root@colibri-imx6:/sys/bus/iio/devices/iio:device0# reboot now
login as: root
Last login: Mon Apr 29 09:05:35 2019 from ##.##.##.##
root@colibri-imx6:~# cd /sys/bus/iio/devices/iio\:device0
root@colibri-imx6:/sys/bus/iio/devices/iio:device0# cat in_voltage6_raw in_voltage7_raw
0
2047
root@colibri-imx6:/sys/bus/iio/devices/iio:device0# cat in_voltage6_raw in_voltage7_raw
0
2039
root@colibri-imx6:/sys/bus/iio/devices/iio:device0# cat in_voltage6_raw in_voltage7_raw
0
2048
Does anyone have any idea what could be causing this?
Thanks in advance!