I'm re-posting this from https://ez.analog.com/mems/f/q-a/554669/adis16497-3bmlz-all-iio_reg-outputs-and-all-_raw-measurements-always-0/447031, since this seems a more appropriate forum for the question.
---------------------------------------------------------------------------------------------
Hi, I'm trying to read data from an ADIS16497-3BMLZ connected to an EVAL-ADISIMU1-RPIZ board which is in turn connected to a Raspberry Pi 4B running the Raspberry Pi build of Ubuntu Server 20 LTS.
I've managed to install the drivers using modprobe and I adapted the device tree overlay from https://github.com/analogdevicesinc/linux/blob/rpi-4.19.y/arch/arm/boot/dts/overlays/adis16480-overlay.dts (swapping the pins out so that pin 25 is interrupt and pin 12 is reset). I also removed the #include statements and substituted the enums for their actual values so that I didn't need to use cpp to build the overlay .dtbo I've built it and moved it to /boot/overlays/ and added required line into /boot/config.txt
I've also installed iio-oscilloscope and all of its dependencies.
I can now apparently see the device as /sys/bus/iio/devices/iio:device0, but all values returned from commands like cat /sys/bus/iio/devices/iio\:device0/in_accel_x_raw return 0 (i.e. all of the raw output is 0).
dmesg | grep iio returns "iio:device0: Device ID(16497) and product ID(0) do not match."
And using iio_reg to fetch the value of any register at all always returns 0.
I conclude that I've somehow configured the overlay or the driver incorrectly, but there's another issue: The IMU I'm using may have been damaged by an earlier engineer. Ideally I'd like to check the self-test registry entries, but as already mentioned I can't get anything other than zeros out of the platform.
The content of my .dts file is below. Any help whatsoever in talking to this IMU would be really great!
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2835";
fragment@0 {
target = <&spi0>;
__overlay__ {
status = "okay";
};
};
fragment@1 {
target = <&spidev0>;
__overlay__ {
status = "disabled";
};
};
fragment@2 {
target = <&spidev1>;
__overlay__ {
status = "disabled";
};
};
fragment@3 {
target = <&gpio>;
__overlay__ {
adis16480_pins: adis16480_pins {
brcm,pins = <25 12>; // interrupt and reset
brcm,function = <0 1>; // in out
};
};
};
fragment@4 {
target = <&spi0>;
__overlay__ {
/* needed to avoid dtc warning */
#address-cells = <1>;
#size-cells = <0>;
adis16480: adis16480@0 {
compatible = "adi,adis16497-3";
reg = <0>;
pinctrl-names = "default";
pinctrl-0 = <&adis16480_pins>;
spi-cpha;
spi-cpol;
reset-gpios = <&gpio 12 1>; // GPIO_ACTIVE_LOW
spi-max-frequency = <15000000>;
/* use DIO1 as data ready by default */
interrupts = <25 0x00000002>; // IRQF_TRIGGER_FALLING
interrupt-parent = <&gpio>;
};
};
};
__overrides__ {
interrupt = <&adis16480_pins>,"brcm,pins:0",
<&adis16480>,"interrupts:0";
reset = <&adis16480_pins>,"brcm,pins:4",
<&adis16480>,"reset-gpios:4";
};
};
----------------------------------------------------------------
I can add a bit more debugging detail to this now:
I've loaded the 28th July release of the ADI-Kuiper-Linux image onto an SD card and placed it into the same Raspberry Pi. Hopefully this will make it easier for others here to help me.
The only additional setup done was to add "dtoverlay=adis16480" to /boot/config.txt
After doing that, iio_info shows the same symptoms as above: every field is zero. Similarly with the oscilloscope - after adding adis16495-3-dev0 as a trigger, enabling all streams and hitting "play", I get the messages "Error while reading data: Connection times out" and "ERROR: Error during buffer disable: Function not implemented (38)" in the console. And of course no data from the IMU. Similarly using the Debug tab, I can't read any register values from the IMU at all.
I think this means my IMU is dead, but I'd really like some way to confirm that.