Post Go back to editing

ADIS16488 on Raspberrypi 3 Unable to refill buffer: Connection timed out

I'm trying to read from ADIS16488 device using libiio (iio_readdev), by this command

$ ./iio_readdev -t adis16480-dev0 adis16480

WARNING: High-speed mode not enabled

Unable to refill buffer: Connection timed out

I'm using this devicetree:

/*

* adis16480-overlay.dts

*

* ADIS16480 IMU (inertial measurement unit) connected to spi0 on Raspberry Pi

*

*/

 

/dts-v1/;

/plugin/;

 

/ {

    compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";

 

    /* the interrupt pin of the adis device */

    fragment@0 {

        target = <&gpio>;

        __overlay__ {

        adis_pins: adis_pins {

                brcm,pins = <25>;

                brcm,function = <0>; /* input */

                bcrm,pull = <0>; /* disable pull-over */

            };

        };

    };

 

    fragment@1 {

        target = <&spi0>;

        __overlay__ {

            status = "okay";

 

            /* needed to avoid dtc warning */

            #address-cells = <1>;

            #size-cells = <0>;

 

            spidev@0{

                status = "disabled";

            };

 

            imu@0 {

                compatible = "adi,adis16480";

                reg = <0>;

                spi-cpol;

                spi-cpha;

                spi-max-frequency = <10000000>;

 

                interrupt-parent = <&gpio>;

                interrupts = <25 1>; /* IRQ_TYPE_EDGE_RISING */

 

                pinctrl-names = "default";

                pinctrl-0 = <&adis_pins>;

            };

        };

    };

};

Thanks in advance.

  • Hi,

    Please check that the IRQ is triggering. `cat /proc/interrupt` before and after running running iio_readdev.

    - Lars

  • In the future, you might want to consider posting this type of request in the Linux forum, as that community has a much wider user base that is familiar with this subject matter. No problem from my point of view, as we have colleagues that we can tag for their counsel. I just wanted you to be aware of this option.


    larsc 

    Is this something that you (or someone in the Linux Community) can help with? Many thanks!!

  • Hi,

    OK, that explains the timeout. Next step is to find out why you are not getting any interrupts from the ADIS16488. First thing is to double check that the DIO1 pin of the ADIS16488 is connected to the GPIO that is specified in your devicetree.

    If you have a scope or logic analyzer you can also check the physical signal coming from the DIO1 to verify whether the interrupt is generated or not.

    - Lars

  • Thanks for reply, the IRQ work interrupt is 0 before and after running iio_readdev

    pi@raspberrypi:~/Downloads/libiio/tests $ cat /proc/interrupts
               CPU0       CPU1       CPU2       CPU3       
     16:          0          0          0          0  bcm2836-timer   0 Edge      arch_timer
     17:       2147       1597       1735       1596  bcm2836-timer   1 Edge      arch_timer
     23:         37          0          0          0  ARMCTRL-level   1 Edge      3f00b880.mailbox
     24:        204          0          0          0  ARMCTRL-level   2 Edge      VCHIQ doorbell
     39:          1          0          0          0  ARMCTRL-level  41 Edge    
     46:          6          0          0          0  ARMCTRL-level  48 Edge      bcm2708_fb dma
     48:       4228          0          0          0  ARMCTRL-level  50 Edge      DMA IRQ
     50:          0          0          0          0  ARMCTRL-level  52 Edge      DMA IRQ
     51:          0          0          0          0  ARMCTRL-level  53 Edge      DMA IRQ
     54:          0          0          0          0  ARMCTRL-level  56 Edge      DMA IRQ
     62:      37055          0          0          0  ARMCTRL-level  64 Edge      dwc_otg, dwc_otg_pcd, dwc_otg_hcd:usb1
     79:          0          0          0          0  ARMCTRL-level  81 Edge      3f200000.gpio:bank0
     80:          0          0          0          0  ARMCTRL-level  82 Edge      3f200000.gpio:bank1
     84:          0          0          0          0  ARMCTRL-level  86 Edge      3f204000.spi
     86:        326          0          0          0  ARMCTRL-level  88 Edge      mmc0
     87:       5002          0          0          0  ARMCTRL-level  89 Edge      uart-pl011
     92:       3432          0          0          0  ARMCTRL-level  94 Edge      mmc1
    191:          0          0          0          0  pinctrl-bcm2835  25 Edge      adis16480
    FIQ:              usb_fiq
    IPI0:          0          0          0          0  CPU wakeup interrupts
    IPI1:          0          0          0          0  Timer broadcast interrupts
    IPI2:       5122       7362       6377       6093  Rescheduling interrupts
    IPI3:         10         13         10          9  Function call interrupts
    IPI4:          5          7        121         25  Single function call interrupts
    IPI5:          0          0          0          0  CPU stop interrupts
    IPI6:          0          0          0          0  IRQ work interrupts
    IPI7:          0          0          0          0  completion interrupts
    Err:          0
    pi@raspberrypi:~/Downloads/libiio/tests $ sudo ./iio_readdev -t adis16480-dev0 iio:device0
    WARNING: High-speed mode not enabled
    Unable to refill buffer: Connection timed out
    pi@raspberrypi:~/Downloads/libiio/tests $ cat /proc/interrupts
               CPU0       CPU1       CPU2       CPU3       
     16:          0          0          0          0  bcm2836-timer   0 Edge      arch_timer
     17:       2304       3873       1995       1911  bcm2836-timer   1 Edge      arch_timer
     23:         40          0          0          0  ARMCTRL-level   1 Edge      3f00b880.mailbox
     24:        204          0          0          0  ARMCTRL-level   2 Edge      VCHIQ doorbell
     39:          1          0          0          0  ARMCTRL-level  41 Edge    
     46:          6          0          0          0  ARMCTRL-level  48 Edge      bcm2708_fb dma
     48:       4283          0          0          0  ARMCTRL-level  50 Edge      DMA IRQ
     50:          0          0          0          0  ARMCTRL-level  52 Edge      DMA IRQ
     51:          0          0          0          0  ARMCTRL-level  53 Edge      DMA IRQ
     54:          0          0          0          0  ARMCTRL-level  56 Edge      DMA IRQ
     62:      62156          0          0          0  ARMCTRL-level  64 Edge      dwc_otg, dwc_otg_pcd, dwc_otg_hcd:usb1
     79:          0          0          0          0  ARMCTRL-level  81 Edge      3f200000.gpio:bank0
     80:          0          0          0          0  ARMCTRL-level  82 Edge      3f200000.gpio:bank1
     84:          0          0          0          0  ARMCTRL-level  86 Edge      3f204000.spi
     86:        359          0          0          0  ARMCTRL-level  88 Edge      mmc0
     87:       5002          0          0          0  ARMCTRL-level  89 Edge      uart-pl011
     92:       3432          0          0          0  ARMCTRL-level  94 Edge      mmc1
    191:          0          0          0          0  pinctrl-bcm2835  25 Edge      adis16480
    FIQ:              usb_fiq
    IPI0:          0          0          0          0  CPU wakeup interrupts
    IPI1:          0          0          0          0  Timer broadcast interrupts
    IPI2:       5323       7774       6476       6636  Rescheduling interrupts
    IPI3:         10         13         10          9  Function call interrupts
    IPI4:          5          7        121         25  Single function call interrupts
    IPI5:          0          0          0          0  CPU stop interrupts
    IPI6:          0          0          0          0  IRQ work interrupts
    IPI7:          0          0          0          0  completion interrupts
    Err:          0

    -Joe Smith