I am currently working with BBB to get data from adis16365 through spi but not able to make it work.adis16365 is of adis16400 family.
I have added the following configuration in am335x-boneblack.dts file.
spi0_pins_default: spi0_pins_default { pinctrl-single,pins = < AM33XX_IOPAD(0x950, PIN_OUTPUT_PULLUP | MUX_MODE0) /* P9_22 (A17) spi0_sclk SCLK */ AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE0) /* P9_18 (B16) spi0_d1 MISO */ AM33XX_IOPAD(0x954, PIN_OUTPUT_PULLUP | MUX_MODE0) /* P9_21 (B17) spi0_d0 MOSI */ AM33XX_IOPAD(0x95c, PIN_OUTPUT_PULLUP | MUX_MODE0) /* P9_17 (A16) spi0_cs0 CS0 */ AM33XX_IOPAD(0x960, PIN_OUTPUT_PULLUP | MUX_MODE0) /* P9_16 (C15) spi0_cs1 CS1 */ >;
}; &spi0 { pinctrl-names = "default"; pinctrl-0 = <&spi0_pins_default>; status = "okay"; ti,spi-num-cs = <2>; ti,pindir-d0-out-d1-in = <1>; spidev@1 { compatible = "adi,adis16400"; spi-max-frequency = <1000000>; reg = <1>; //chipselect 1 spi-cpol = <1>; spi-cpha = <1>; };};
I have also loaded the driver of adis16400 through the developer shell. The iio:device1 is visible in /sys/bus/iio/devices. Doing a 'ls' in this directory will list the following values.
root@beaglebone-yocto:/sys/bus/iio/devices/iio:device1# ls buffer in_magn_scale current_timestamp_clock in_magn_x_raw dev in_magn_y_raw in_accel_filter_low_pass_3db_frequency in_magn_z_raw in_accel_scale in_temp0_offset in_accel_x_calibbias in_temp0_raw in_accel_x_raw in_temp0_scale in_accel_y_calibbias in_voltage0_supply_raw in_accel_y_raw in_voltage0_supply_scale in_accel_z_calibbias in_voltage1_raw in_accel_z_raw in_voltage1_scale in_anglvel_filter_low_pass_3db_frequency name in_anglvel_scale of_node in_anglvel_x_calibbias power in_anglvel_x_raw sampling_frequency in_anglvel_y_calibbias scan_elements in_anglvel_y_raw subsystem in_anglvel_z_calibbias trigger in_anglvel_z_raw uevent in_magn_filter_low_pass_3db_frequency
But almost all of these values return 0. For instance,
root@beaglebone-yocto:/sys/bus/iio/devices/iio:device1# cat in_accel_x_raw 0
root@beaglebone-yocto:/sys/bus/iio/devices/iio:device1# cat in_anglvel_x_raw 0
I am also getting this error when I grep iio through dmesg:
root@beaglebone-yocto:~# dmesg | grep iio [ 11.084613] iio iio:device1: Device ID(16400) and product ID(0) do not match. [ 11.165153] iio iio:device1: adis16400: prod_id 0x0000 at CS1 (irq 0)
How can this be solved? Any help is highly appreciated.