Post Go back to editing

AD7124 pyadi-iio rx() function is constant

Category: Software
Product Number: AD7124-8
Software Version: Kuiper linux 2022_R2, pyadi-iio 0.0.16

Kuiper linux downloaded from here (2022_r2) and use it on Raspberry Pi Model B.

I am using eval-ad7124-8sdz board using SPI connection following

Strangely under /boot/overlays, it only has rpi-ad7124-8-all-diff.dtbo, and does not have rpi-ad7124-8-all-diff-cs0-int25-overlay.dtbo. So in order to use the interruption line GPIO 25, I downloaded

and compiled using 

sudo bash -c 'dtc -I dts -O dtb /home/analog/Downloads/rpi-ad7124-8-all-diff-cs0-int25-overlay.dts > /boot/overlays/rpi-ad7124-8-all-diff-cs0-int25-overlay.dtbo'

When I run, the data returned by rx() is a constant array, instead of a sin function that I used as input.

When I tune the input to a constant DC voltage, rx() indeed returns (roughly) that voltage, repeated 1024 times (as rx_buffer_size = 1024). Therefore I believe the rx() function is only reading once, instead of continuously reading 1024 times. 

Since the Kuiper linux does not contain rpi-ad7124-8-all-diff-cs0-int25-overlay.dtbo and I have to recompile it from scratch, my guess is the Kuiper linux that I am using is incorrect. Could you confirm what is the correct Kuiper linux download link that contains the correct code for ad7124-8, and also why rx() is returning a constant instead of a continuous read?

Thread Notes

Top Replies

Parents Reply
  • Thank you so much for the links! I am not very familiar with the Linux file structure. Right now on my Raspberry Pi, which has 2022_R2 Kuiper Linux installed, shall I delete the contents of /boot and /lib/modules directories, and put the files in your links into the respective directories? The rpi_modules link has 3 folders, which one should I use?

  • No need to delete, I just usually overwrite (/boot and /lib/modules) by copying all files as it is.
    Its fine to copy all the 3 folders under rpi_modules to /lib/modules but if you are constrained with storage, you could just copy the folder that corresponds to your RPI variant,
    ex. RPI4 -> 6.1.54-v7l+, RPI3 -> 6.1.54-v7+

  • Hi Kimpaller, I extracted the files as you said, but now when I use iio_info command, it can not find the ad7124 device. I also don't see an error loading the device tree overlay, so I guess the new kernel is not loading the device tree. Could you get the kernel to work properly for rpi-6.1.y?