Post Go back to editing

ad7768-1 Unable to refill buffer: Connection timed out (110) error on custom Yocto build with cn0540 and de10-nano

Category: Software
Product Number: ad7768-1

I have a cn0540 attached to a de10-nano with a custom Yocto image with libiio v0.23. When I run "iio_readdev ad7768-1" I get the error "Unable to refill buffer: Connection timed out (110)". From the other questions I've seen online about this problem, It seems to be caused by the interrupts not being set right in the device tree. However, the device tree I'm using is the de10-nano cn0540 one from the adi linux fork, so I don't think that is my problem. Because this is a custom Yocto build, I'm using the socfpga linux fork v5.13, this fork has outdated ad7768-1 drivers, so I patched them and related files. The list of files I've patched to be the version from the adi linux fork are:

ad7768-1.c
buffer-dma.h
buffer-dmaengine.h
buffer_impl.h
iio/consumer.h
iio_core.h
iio.h
iio-opaque.h
iio-triggered-buffer.c
industrialio-buffer.c
industrialio-buffer-cb.c
industrialio-buffer-da.c
industrialio-buffer-dmaengine.c
industrialio-core.c
industrialio-hw-consumer.c
industrialio-trigger.c
inkern.c
irq.h
spi-axi-spi-engine.c
types.h
uapi/types.h

I also have a kernel fragment which is:

CONFIG_IIO_BUFFER=y
CONFIG_IIO_BUFFER_CB=y
CONFIG_IIO_BUFFER_HW_CONSUMER=y
CONFIG_IIO_BUFFER_DMA=y
CONFIG_IIO_BUFFER_DMAENGINE=y
CONFIG_IIO_KFIFO_BUF=y
CONFIG_IIO_TRIGGERED_BUFFER=y
CONFIG_IIO_TRIGGER=y
CONFIG_IIO_CONSUMERS_PER_TRIGGER=2
CONFIG_AD7768_1=y
 
CONFIG_SPI_AXI_SPI_ENGINE=y
CONFIG_DMA_VIRTUAL_CHANNELS=y
CONFIG_AXI_DMAC=y
 
CONFIG_IIO_INTERRUPT_TRIGGER=y
CONFIG_IIO_SYSFS_TRIGGER=y

I still think my issue is related to interrupts because, when I run "cat proc/interrupts" before running "iio_readdev ad7768-1" I get:

           CPU0       CPU1
 24:       1996       1770     GIC-0  29 Edge      twd
 25:          0          0     GIC-0 199 Level     timer0
 26:          0          0     GIC-0 201 Level     timer2
 27:          0          0     GIC-0 202 Level     timer3
 28:          0          0     GIC-0 208 Level     arm-pmu
 29:          0          0     GIC-0 209 Level     arm-pmu
 30:          0          0     GIC-0 136 Level     ffe01000.pdma
 31:         29          0     GIC-0 137 Level     ffe01000.pdma
 32:          0          0     GIC-0 138 Level     ffe01000.pdma
 33:          0          0     GIC-0 139 Level     ffe01000.pdma
 34:          0          0     GIC-0 140 Level     ffe01000.pdma
 35:          0          0     GIC-0 141 Level     ffe01000.pdma
 36:          0          0     GIC-0 142 Level     ffe01000.pdma
 37:          0          0     GIC-0 143 Level     ffe01000.pdma
 38:          0          0     GIC-0 207 Level     ff706000.fpgamgr
 39:          0          0     GIC-0 152 Level     eth0
 40:          0          0     GIC-0 190 Level     ffc04000.i2c
 41:          0          0     GIC-0 191 Level     ffc05000.i2c
 43:       3000          0     GIC-0 171 Level     dw-mci
 46:         22          0     GIC-0 194 Level     ttyS0
 48:          0          0     GIC-0 160 Level     ffb40000.usb, ffb40000.usb, dwc2_hsotg:usb1
 49:          0          0     GIC-0 203 Edge      ffd02000.watchdog
 51:          0          0     GIC-0  79 Level     ff280000.dma
 52:          0          0     GIC-0  76 Level     ff220000.rx-dma
 53:          5          0     GIC-0  77 Level     ff230000.spi
IPI0:          0          0  CPU wakeup interrupts
IPI1:          0          0  Timer broadcast interrupts
IPI2:         24         25  Rescheduling interrupts
IPI3:        397        701  Function call interrupts
IPI4:          0          0  CPU stop interrupts
IPI5:          0          0  IRQ work interrupts
IPI6:          0          0  completion interrupts
Err:          0
and after I get:
           CPU0       CPU1
 24:      14146      13291     GIC-0  29 Edge      twd
 25:          0          0     GIC-0 199 Level     timer0
 26:          0          0     GIC-0 201 Level     timer2
 27:          0          0     GIC-0 202 Level     timer3
 28:          0          0     GIC-0 208 Level     arm-pmu
 29:          0          0     GIC-0 209 Level     arm-pmu
 30:          0          0     GIC-0 136 Level     ffe01000.pdma
 31:         65          0     GIC-0 137 Level     ffe01000.pdma
 32:          0          0     GIC-0 138 Level     ffe01000.pdma
 33:          0          0     GIC-0 139 Level     ffe01000.pdma
 34:          0          0     GIC-0 140 Level     ffe01000.pdma
 35:          0          0     GIC-0 141 Level     ffe01000.pdma
 36:          0          0     GIC-0 142 Level     ffe01000.pdma
 37:          0          0     GIC-0 143 Level     ffe01000.pdma
 38:          0          0     GIC-0 207 Level     ff706000.fpgamgr
 39:          0          0     GIC-0 152 Level     eth0
 40:          0          0     GIC-0 190 Level     ffc04000.i2c
 41:          0          0     GIC-0 191 Level     ffc05000.i2c
 43:       4314          0     GIC-0 171 Level     dw-mci
 46:         49          0     GIC-0 194 Level     ttyS0
 48:          0          0     GIC-0 160 Level     ffb40000.usb, ffb40000.usb, dwc2_hsotg:usb1
 49:          0          0     GIC-0 203 Edge      ffd02000.watchdog
 51:          0          0     GIC-0  79 Level     ff280000.dma
 52:          2          0     GIC-0  76 Level     ff220000.rx-dma
 53:          7          0     GIC-0  77 Level     ff230000.spi
IPI0:          0          0  CPU wakeup interrupts
IPI1:          0          0  Timer broadcast interrupts
IPI2:         27         26  Rescheduling interrupts
IPI3:        439       1157  Function call interrupts
IPI4:          0          0  CPU stop interrupts
IPI5:          0          0  IRQ work interrupts
IPI6:          0          0  completion interrupts
Err:          0
, I would expect the count for "ff280000.dma" to go up, but maybe I'm wrong in that assumption.

I am new to embedded linux, and even more so iio devices, and am very lost at solving this issue, any help would be appreciated. Thank you.

  • I tried changing the kernel from the altera fork, to the adi fork, with no effect.

    I can confirm that this is just a software issue, because I've tried the demo image provided by adi and it works fine.

  • I have also confirmed the IRQ is set correctly in the HDL. It's set to FPGA_IRQ4 which maps to GIC 76

  • Calling "iio_info" I get:

    Library version: 0.23 (git tag: 92d6a35)
    Compiled with backends: local xml ip usb serial
    IIO context created with local backend.
    Backend version: 0.23 (git tag: 92d6a35)
    Backend description string: Linux VibMonProto 5.15.0-yocto-standard-adi #1 SMP Thu Apr 27 16:34:06 UTC 2023 armv7l
    IIO context has 2 attributes:
            local,kernel: 5.15.0-yocto-standard-adi
            uri: local:
    IIO context has 2 devices:
            iio:device0: ad7768-1 (buffer capable)
                    1 channels found:
                            voltage0:  (input, index: 0, format: le:s24/32>>8)
                            3 channel-specific attributes found:
                                    attr  0: label value: (null)
                                    attr  1: raw value: 2831272
                                    attr  2: scale value: 0.000488281
                    4 device-specific attributes found:
                                    attr  0: common_mode_voltage value: (AVDD1-AVSS)/2
                                    attr  1: common_mode_voltage_available value: (AVDD1-AVSS)/2 2V5 2V05 1V9 1V65 1V1 0V9 OFF
                                    attr  2: sampling_frequency value: 256000
                                    attr  3: sampling_frequency_available value: 256000 128000 64000 32000 16000 8000 4000 2000 1000
                    3 buffer-specific attributes found:
                                    attr  0: data_available value: 0
                                    attr  1: length_align_bytes value: 16
                                    attr  2: watermark value: 2048
                    1 debug attributes found:
                                    debug attr  0: direct_reg_access value: 0x0
                    No trigger on this device
            iio_sysfs_trigger:
                    0 channels found:
                    2 device-specific attributes found:
                                    attr  0: add_trigger ERROR: Permission denied (13)
                                    attr  1: remove_trigger ERROR: Permission denied (13)
                    No trigger on this device
    
    If I call it multiple times, the raw value attribute will change. So for some reason it's just the buffering that's not working.

  • I probed the DRDY pin of the board, and it is never sent high.  So it's probably not the interrupt.

  • Hi Wyatt,

    In order to rule out hardware issues, have you tried running the setup with the standard Kuiper image, documented here: https://wiki.analog.com/resources/eval/user-guides/circuits-from-the-lab/cn0540/de10-nano ?

    I see that that page still refers to a custom image, which should still work, although I do see that the the CN0540 boot files are in the Kuiper 2021_R2 release (which released a month ago, despite the 2021 in the name.)

    -Mark

  • Yes, using the standard Kuiper image, the device functions as intended. The only difference for my custom image is to use the U-boot "fpga" command to program the fpga, I have to set the fpga mode switches to be "FPPx16 / Compression Disabled / Fast POR"  rather than "FPPx32 / Compression Enabled / Fast POR (Default)" which is needed for the Kuiper image. My understanding is this just changes how the fpga is programmed and doesn't affect how it functions.

  • I have switched which libiio version I'm using from 0.23 to 0.21 the same as the Kuiper image and this changed the output of "iio_readdev ad7768-1" to

    "Unable to refill buffer: Connection timed out

    ERROR: Error during buffer disable: No such file or directory"

    I'm not sure if the error is actually any different from the original or if this version of libiio reports the same error differently.

  • Some updates:

    I switched my defconfig from socfpga_defconfig to socfpga_adi_defconfig that changed the result of iio_info to 

    Library version: 0.23 (git tag: 92d6a35)
    Compiled with backends: local xml ip usb serial
    IIO context created with local backend.
    Backend version: 0.23 (git tag: 92d6a35)
    Backend description string: Linux VibMonProto 5.15.0-yocto-standard-adi #1 SMP Thu Apr 27 16:34:06 UTC 2023 armv7l
    IIO context has 2 attributes:
            local,kernel: 5.15.0-yocto-standard-adi
            uri: local:
    IIO context has 5 devices:
            iio:device0: ad7768-1 (buffer capable)
                    1 channels found:
                            voltage0:  (input, index: 0, format: le:s24/32>>8)
                            3 channel-specific attributes found:
                                    attr  0: label value: (null)
                                    attr  1: raw value: -2185387
                                    attr  2: scale value: 0.000488281
                    4 device-specific attributes found:
                                    attr  0: common_mode_voltage value: (AVDD1-AVSS)/2
                                    attr  1: common_mode_voltage_available value: (AVDD1-AVSS)/2 2V5 2V05 1V9 1V65 1V1 0V9 OFF
                                    attr  2: sampling_frequency value: 256000
                                    attr  3: sampling_frequency_available value: 256000 128000 64000 32000 16000 8000 4000 2000 1000
                    3 buffer-specific attributes found:
                                    attr  0: data_available value: 0
                                    attr  1: length_align_bytes value: 16
                                    attr  2: watermark value: 2048
                    1 debug attributes found:
                                    debug attr  0: direct_reg_access value: 0x0
                    No trigger on this device
            iio:device1: ltc2308
                    8 channels found:
                            voltage6:  (input)
                            2 channel-specific attributes found:
                                    attr  0: raw value: 146
                                    attr  1: scale value: 1.000000000
                            voltage3:  (input)
                            2 channel-specific attributes found:
                                    attr  0: raw value: 134
                                    attr  1: scale value: 1.000000000
                            voltage7:  (input)
                            2 channel-specific attributes found:
                                    attr  0: raw value: 145
                                    attr  1: scale value: 1.000000000
                            voltage0:  (input)
                            2 channel-specific attributes found:
                                    attr  0: raw value: 135
                                    attr  1: scale value: 1.000000000
                            voltage4:  (input)
                            2 channel-specific attributes found:
                                    attr  0: raw value: 140
                                    attr  1: scale value: 1.000000000
                            voltage1:  (input)
                            2 channel-specific attributes found:
                                    attr  0: raw value: 136
                                    attr  1: scale value: 1.000000000
                            voltage5:  (input)
                            2 channel-specific attributes found:
                                    attr  0: raw value: 136
                                    attr  1: scale value: 1.000000000
                            voltage2:  (input)
                            2 channel-specific attributes found:
                                    attr  0: raw value: 135
                                    attr  1: scale value: 1.000000000
                    2 device-specific attributes found:
                                    attr  0: sleep_mode value: DISABLED
                                    attr  1: sleep_mode_available value: DISABLED ENABLED
                    No trigger on this device
            iio:device2: one-bit-adc-dac
                    8 channels found:
                            voltage0:  (input)
                            2 channel-specific attributes found:
                                    attr  0: label value: cn0540_sw_ff_gpio
                                    attr  1: raw value: 0
                            voltage1:  (output)
                            2 channel-specific attributes found:
                                    attr  0: label value: cn0540_red_led
                                    attr  1: raw value: 0
                            voltage5:  (output)
                            2 channel-specific attributes found:
                                    attr  0: label value: cn0540_FDA_DIS
                                    attr  1: raw value: 0
                            voltage0:  (output)
                            2 channel-specific attributes found:
                                    attr  0: label value: cn0540_blue_led
                                    attr  1: raw value: 0
                            voltage3:  (output)
                            2 channel-specific attributes found:
                                    attr  0: label value: cn0540_ad7768-1-gpio0
                                    attr  1: raw value: 0
                            voltage6:  (output)
                            2 channel-specific attributes found:
                                    attr  0: label value: cn0540_FDA_MODE
                                    attr  1: raw value: 0
                            voltage2:  (output)
                            2 channel-specific attributes found:
                                    attr  0: label value: cn0540_shutdown_gpio
                                    attr  1: raw value: 0
                            voltage4:  (output)
                            2 channel-specific attributes found:
                                    attr  0: label value: cn0540_ad7768-1-gpio1
                                    attr  1: raw value: 0
                    No trigger on this device
            iio:device3: ltc2606
                    1 channels found:
                            voltage0:  (output)
                            5 channel-specific attributes found:
                                    attr  0: powerdown value: 0
                                    attr  1: powerdown_mode value: 90kohm_to_gnd
                                    attr  2: powerdown_mode_available value: 90kohm_to_gnd
                                    attr  3: raw value: 32768
                                    attr  4: scale value: 0.062500000
                    No trigger on this device
            iio_sysfs_trigger:
                    0 channels found:
                    2 device-specific attributes found:
                                    attr  0: add_trigger ERROR: Permission denied (13)
                                    attr  1: remove_trigger ERROR: Permission denied (13)
                    No trigger on this device

    I've also found some differences from the standard Kuiper image and my custom image.

    My custom image has a buffer and buffer0 directory, while the Kuiper image has only buffer.

    If I try to read the buffer manually with:

    "echo 1 > scan_elements/in_voltage0_en"

    "echo 1 > buffer/enable"

    both of those commands run the same on both images, however when I call

    "cat /dev/iio:device0 | hexdump"

    on the Kuiper image, I get a bunch of hex, but on my custom image the device crashes.

  • although I do see that the the CN0540 boot files are in the Kuiper 2021_R2 release (which released a month ago, despite the 2021 in the name.)

    Do you mean the device tree files in the adi kernel fork?

  • I've found out that if I set the length of the buffer to 1 then try and read it I get some error output

    > echo 1 > buffer/length
    > echo 1 > scan_elements/in_voltage0_en
    > echo 1 > buffer/enable
    > cat /dev/iio:device0 | hexdump

    [  441.310599] rcu: INFO: rcu_sched self-detected stall on CPU
    [  441.316258] rcu:     0-....: (2099 ticks this GP) idle=10f/1/0x40000002 softirq=2509/2509 fqs=1033
    [  441.325163]  (t=2100 jiffies g=497 q=7)
    [  441.329057] NMI backtrace for cpu 0
    [  441.332592] CPU: 0 PID: 163 Comm: cat Not tainted 5.15.0-yocto-standard-adi #1
    [  441.339927] Hardware name: Altera SOCFPGA
    [  441.343988] Backtrace:
    [  441.346453] [<c0d914b0>] (dump_backtrace) from [<c0d916fc>] (show_stack+0x20/0x24)
    [  441.354073]  r7:c010edfc r6:00000000 r5:60070193 r4:c143b218
    [  441.359801] [<c0d916dc>] (show_stack) from [<c0d94ecc>] (dump_stack_lvl+0x48/0x54)
    [  441.367360] [<c0d94e84>] (dump_stack_lvl) from [<c0d94ef0>] (dump_stack+0x18/0x1c)
    [  441.374907]  r5:00000000 r4:20070193
    [  441.378525] [<c0d94ed8>] (dump_stack) from [<c05850fc>] (nmi_cpu_backtrace+0xe0/0x114)
    [  441.386424] [<c058501c>] (nmi_cpu_backtrace) from [<c0585218>] (nmi_trigger_cpumask_backtrace+0xe8/0x134)
    [  441.395965]  r7:c010edfc r6:c0e01ee4 r5:c170469c r4:00000000
    [  441.401597] [<c0585130>] (nmi_trigger_cpumask_backtrace) from [<c010fd68>] (arch_trigger_cpumask_backtrace+0x20/0x24)
    [  441.412180]  r9:c1703f10 r8:c0e01ee0 r7:c1835438 r6:00000000 r5:c1703fa4 r4:c171e840
    [  441.419886] [<c010fd48>] (arch_trigger_cpumask_backtrace) from [<c0d9340c>] (rcu_dump_cpu_stacks+0x144/0x174)
    [  441.429922] [<c0d932c8>] (rcu_dump_cpu_stacks) from [<c0198490>] (rcu_sched_clock_irq+0x6a8/0xa58)
    [  441.438860]  r10:2e138000 r9:c1702d00 r8:c1693f40 r7:c18361a0 r6:00000000 r5:ef7cbf40
    [  441.446784]  r4:c171e840
    [  441.449304] [<c0197de8>] (rcu_sched_clock_irq) from [<c01a354c>] (update_process_times+0x98/0xc4)
    [  441.458174]  r10:c1702d80 r9:c1702d40 r8:c184fd40 r7:2e138000 r6:c1702d00 r5:00000000
    [  441.465969]  r4:ef7c5540
    [  441.468524] [<c01a34b4>] (update_process_times) from [<c01b74e0>] (tick_sched_timer+0x88/0x2d8)
    [  441.477198]  r7:c1ea9dc0 r6:00000066 r5:bf87a4da r4:ef7c6128
    [  441.482830] [<c01b7458>] (tick_sched_timer) from [<c01a4260>] (__hrtimer_run_queues+0x1fc/0x36c)
    [  441.491730]  r10:ef7c5e14 r9:ef7c6128 r8:20070193 r7:00000000 r6:c01b7458 r5:ef7c5dc0
    [  441.499645]  r4:ef7c5e00
    [  441.502183] [<c01a4064>] (__hrtimer_run_queues) from [<c01a5158>] (hrtimer_interrupt+0x13c/0x2c8)
    [  441.511041]  r10:ef7c5e98 r9:ef7c5e70 r8:ef7c5e48 r7:ef7c5dcc r6:00000003 r5:20070193
    [  441.518836]  r4:ef7c5dc0
    [  441.521357] [<c01a501c>] (hrtimer_interrupt) from [<c0110744>] (twd_handler+0x44/0x4c)
    [  441.529394]  r10:c1ea8000 r9:c1ea9dc0 r8:f080210c r7:c1d08240 r6:00000018 r5:c17046b4
    [  441.537301]  r4:00000001
    [  441.539821] [<c0110700>] (twd_handler) from [<c01838c8>] (handle_percpu_devid_irq+0x9c/0x200)
    [  441.548321]  r5:c17046b4 r4:c1d09000
    [  441.551888] [<c018382c>] (handle_percpu_devid_irq) from [<c017ced4>] (handle_domain_irq+0x6c/0x88)
    [  441.560961]  r7:0000001d r6:00000000 r5:00000000 r4:c1692a14
    [  441.566593] [<c017ce68>] (handle_domain_irq) from [<c0101300>] (gic_handle_irq+0x88/0x9c)
    [  441.574767]  r7:c1692a20 r6:f0802100 r5:c177a344 r4:c17046b4
    [  441.580494] [<c0101278>] (gic_handle_irq) from [<c0100afc>] (__irq_svc+0x5c/0x78)
    [  441.587952] Exception stack(0xc1ea9dc0 to 0xc1ea9e08)
    [  441.593047] 9dc0: c28b3700 00000000 00000000 00000003 00001000 c28b3700 c2b47f40 befe9c04
    [  441.601193] 9de0: c28b3774 befe9c04 c1ea8000 c1ea9e24 c1ea9e28 c1ea9e10 c0a95530 c0a949ac
    [  441.609342] 9e00: 20070013 ffffffff
    [  441.612863]  r9:c1ea8000 r8:c28b3774 r7:c1ea9df4 r6:ffffffff r5:20070013 r4:c0a949ac
    [  441.620699] [<c0a949a0>] (iio_dma_buffer_dequeue) from [<c0a95530>] (iio_dma_buffer_read+0x148/0x19c)
    [  441.629894]  r5:c28b3700 r4:00001000
    [  441.633452] [<c0a953e8>] (iio_dma_buffer_read) from [<c0952618>] (iio_buffer_read+0x178/0x228)
    [  441.642168]  r10:c1ea8000 r9:befe9c04 r8:00001000 r7:00000400 r6:00000002 r5:c1e43000
    [  441.649962]  r4:c28b3700
    [  441.652483] [<c09524a0>] (iio_buffer_read) from [<c0954b24>] (iio_buffer_read_wrapper+0x2c/0x38)
    [  441.661248]  r10:00000003 r9:c0954af8 r8:00001000 r7:00000001 r6:c1ea8000 r5:c1ea9f60
    [  441.669050]  r4:c2b28540
    [  441.671571] [<c0954af8>] (iio_buffer_read_wrapper) from [<c02b2da8>] (vfs_read+0xc4/0x320)
    [  441.679817] [<c02b2ce4>] (vfs_read) from [<c02b348c>] (ksys_read+0x74/0xec)
    [  441.686766]  r10:00000003 r9:00000000 r8:00000000 r7:befe9c04 r6:c1ea8000 r5:c2b28540
    [  441.694560]  r4:c2b28540
    [  441.697081] [<c02b3418>] (ksys_read) from [<c02b351c>] (sys_read+0x18/0x1c)
    [  441.704027]  r9:c1ea8000 r8:c0100244 r7:00000003 r6:b6f681a0 r5:befe9c04 r4:00001000
    [  441.711733] [<c02b3504>] (sys_read) from [<c0100060>] (ret_fast_syscall+0x0/0x48)
    [  441.719310] Exception stack(0xc1ea9fa8 to 0xc1ea9ff0)
    [  441.724344] 9fa0:                   00001000 befe9c04 00000003 befe9c04 00001000 00000000
    [  441.732488] 9fc0: 00001000 befe9c04 b6f681a0 00000003 00000000 01000000 00000003 befe9c04
    [  441.740769] 9fe0: 00000003 befe9bb8 b6e6070f b6de1ae6
    [  504.340599] rcu: INFO: rcu_sched self-detected stall on CPU
    [  504.346271] rcu:     0-....: (8360 ticks this GP) idle=10f/1/0x40000002 softirq=2509/2509 fqs=4096
    [  504.355185]  (t=8403 jiffies g=497 q=159)
    [  504.359260] NMI backtrace for cpu 0
    [  504.362812] CPU: 0 PID: 163 Comm: cat Not tainted 5.15.0-yocto-standard-adi #1
    [  504.370139] Hardware name: Altera SOCFPGA
    [  504.374209] Backtrace:
    [  504.376683] [<c0d914b0>] (dump_backtrace) from [<c0d916fc>] (show_stack+0x20/0x24)
    [  504.384260]  r7:c010edfc r6:00000000 r5:60070193 r4:c143b218
    [  504.389988] [<c0d916dc>] (show_stack) from [<c0d94ecc>] (dump_stack_lvl+0x48/0x54)
    [  504.397658] [<c0d94e84>] (dump_stack_lvl) from [<c0d94ef0>] (dump_stack+0x18/0x1c)
    [  504.405274]  r5:00000000 r4:20070193
    [  504.408832] [<c0d94ed8>] (dump_stack) from [<c05850fc>] (nmi_cpu_backtrace+0xe0/0x114)
    [  504.416842] [<c058501c>] (nmi_cpu_backtrace) from [<c0585218>] (nmi_trigger_cpumask_backtrace+0xe8/0x134)
    [  504.426539]  r7:c010edfc r6:c0e01ee4 r5:c170469c r4:00000000
    [  504.432266] [<c0585130>] (nmi_trigger_cpumask_backtrace) from [<c010fd68>] (arch_trigger_cpumask_backtrace+0x20/0x24)
    [  504.442884]  r9:c1703f10 r8:c0e01ee0 r7:c1835438 r6:00000000 r5:c1703fa4 r4:c171e840
    [  504.450729] [<c010fd48>] (arch_trigger_cpumask_backtrace) from [<c0d9340c>] (rcu_dump_cpu_stacks+0x144/0x174)
    [  504.460781] [<c0d932c8>] (rcu_dump_cpu_stacks) from [<c0198490>] (rcu_sched_clock_irq+0x6a8/0xa58)
    [  504.469719]  r10:2e138000 r9:c1702d00 r8:c1693f40 r7:c18361a0 r6:00000000 r5:ef7cbf40
    [  504.477513]  r4:c171e840
    [  504.480077] [<c0197de8>] (rcu_sched_clock_irq) from [<c01a354c>] (update_process_times+0x98/0xc4)
    [  504.488938]  r10:c1702d80 r9:c1702d40 r8:c184fd40 r7:2e138000 r6:c1702d00 r5:00000000
    [  504.496759]  r4:ef7c5540
    [  504.499323] [<c01a34b4>] (update_process_times) from [<c01b74e0>] (tick_sched_timer+0x88/0x2d8)
    [  504.508014]  r7:c1ea9da8 r6:00000075 r5:6c691e3c r4:ef7c6128
    [  504.513646] [<c01b7458>] (tick_sched_timer) from [<c01a4260>] (__hrtimer_run_queues+0x1fc/0x36c)
    [  504.522408]  r10:ef7c5e14 r9:ef7c6128 r8:20070193 r7:00000000 r6:c01b7458 r5:ef7c5dc0
    [  504.530202]  r4:ef7c5e00
    [  504.532723] [<c01a4064>] (__hrtimer_run_queues) from [<c01a5158>] (hrtimer_interrupt+0x13c/0x2c8)
    [  504.541693]  r10:ef7c5e98 r9:ef7c5e70 r8:ef7c5e48 r7:ef7c5dcc r6:00000003 r5:20070193
    [  504.549608]  r4:ef7c5dc0
    [  504.552147] [<c01a501c>] (hrtimer_interrupt) from [<c0110744>] (twd_handler+0x44/0x4c)
    [  504.560167]  r10:00000000 r9:c1ea9da8 r8:f080210c r7:c1d08240 r6:00000018 r5:c17046b4
    [  504.567970]  r4:00000001
    [  504.570525] [<c0110700>] (twd_handler) from [<c01838c8>] (handle_percpu_devid_irq+0x9c/0x200)
    [  504.579163]  r5:c17046b4 r4:c1d09000
    [  504.582721] [<c018382c>] (handle_percpu_devid_irq) from [<c017ced4>] (handle_domain_irq+0x6c/0x88)
    [  504.591794]  r7:0000001d r6:00000000 r5:00000000 r4:c1692a14
    [  504.597435] [<c017ce68>] (handle_domain_irq) from [<c0101300>] (gic_handle_irq+0x88/0x9c)
    [  504.605721]  r7:c1692a20 r6:f0802100 r5:c177a344 r4:c17046b4
    [  504.611431] [<c0101278>] (gic_handle_irq) from [<c0100afc>] (__irq_svc+0x5c/0x78)
    [  504.619009] Exception stack(0xc1ea9da8 to 0xc1ea9df0)
    [  504.624122] 9da0:                   c28b3700 c2b47f40 00000003 c096d4b0 c2b47f74 c2b47f40
    [  504.632266] 9dc0: c28b3700 befe9c04 c28b3774 00000000 00000000 c1ea9e14 c1ea9e18 c1ea9df8
    [  504.640408] 9de0: c0a9537c c0a95080 20070013 ffffffff
    [  504.645451]  r9:c1ea8000 r8:c28b3774 r7:c1ea9ddc r6:ffffffff r5:20070013 r4:c0a95080
    [  504.653157] [<c0a9501c>] (iio_dma_buffer_submit_block.part.0) from [<c0a9537c>] (iio_dma_buffer_enqueue+0x44/0xb0)
    [  504.663530]  r7:befe9c04 r6:c2b47f40 r5:c28b3700 r4:00000000
    [  504.669249] [<c0a95338>] (iio_dma_buffer_enqueue) from [<c0a95554>] (iio_dma_buffer_read+0x16c/0x19c)
    [  504.678576] [<c0a953e8>] (iio_dma_buffer_read) from [<c0952618>] (iio_buffer_read+0x178/0x228)
    [  504.687178]  r10:c1ea8000 r9:befe9c04 r8:00001000 r7:00000400 r6:00000002 r5:c1e43000
    [  504.694972]  r4:c28b3700
    [  504.697493] [<c09524a0>] (iio_buffer_read) from [<c0954b24>] (iio_buffer_read_wrapper+0x2c/0x38)
    [  504.706258]  r10:00000003 r9:c0954af8 r8:00001000 r7:00000001 r6:c1ea8000 r5:c1ea9f60
    [  504.714121]  r4:c2b28540
    [  504.716642] [<c0954af8>] (iio_buffer_read_wrapper) from [<c02b2da8>] (vfs_read+0xc4/0x320)
    [  504.724939] [<c02b2ce4>] (vfs_read) from [<c02b348c>] (ksys_read+0x74/0xec)
    [  504.731888]  r10:00000003 r9:00000000 r8:00000000 r7:befe9c04 r6:c1ea8000 r5:c2b28540
    [  504.739681]  r4:c2b28540
    [  504.742202] [<c02b3418>] (ksys_read) from [<c02b351c>] (sys_read+0x18/0x1c)
    [  504.749253]  r9:c1ea8000 r8:c0100244 r7:00000003 r6:b6f681a0 r5:befe9c04 r4:00001000
    [  504.757081] [<c02b3504>] (sys_read) from [<c0100060>] (ret_fast_syscall+0x0/0x48)
    [  504.764607] Exception stack(0xc1ea9fa8 to 0xc1ea9ff0)
    [  504.769727] 9fa0:                   00001000 befe9c04 00000003 befe9c04 00001000 00000000
    [  504.777880] 9fc0: 00001000 befe9c04 b6f681a0 00000003 00000000 01000000 00000003 befe9c04
    [  504.786022] 9fe0: 00000003 befe9bb8 b6e6070f b6de1ae6

    This output repeats every ~20s.

    I've also found that if I again set the length of the buffer to 1, but then call iio_info it will output some then cause the system to lock up

    > echo 1 > buffer/length
    > echo 1 > scan_elements/in_voltage0_en
    > echo 1 > buffer/enable
    > iio_info

    Library version: 0.23 (git tag: 92d6a35)
    Compiled with backends: local xml ip usb serial
    IIO context created with local backend.
    Backend version: 0.23 (git tag: 92d6a35)
    Backend description string: Linux VibMonProto 5.15.0-yocto-standard-adi #1 SMP Thu Apr 27 16:34:06 UTC 2023 armv7l
    IIO context has 2 attributes:
            local,kernel: 5.15.0-yocto-standard-adi
            uri: local:
    IIO context has 5 devices:
            iio:device0: ad7768-1 (buffer capable)
                    1 channels found:
                            voltage0:  (input, index: 0, format: le:s24/32>>8)
                            3 channel-specific attributes found:
                                    attr  0: label value: (null)
                                    attr  1: raw ERROR: Device or resource busy (16)
                                    attr  2: scale value: 0.000488281
                    4 device-specific attributes found:
                                    attr  0: common_mode_voltage value: (AVDD1-AVSS)/2
                                    attr  1: common_mode_voltage_available value: (AVDD1-AVSS)/2 2V5 2V05 1V9 1V65 1V1 0V9 OFF
                                    attr  2: sampling_frequency value: 256000
                                    attr  3: sampling_frequency_available value: 256000 128000 64000 32000 16000 8000 4000 2000 1000
                    3 buffer-specific attributes found:
                                    attr  0: data_available value: 16
                                    attr  1: length_align_bytes value: 16
                                    attr  2: watermark value: 2
                    1 debug attributes found:

    The output gets that far, then locks the system up entirely.