AnsweredAssumed Answered

Crash while trying to read data from AD7476 via IIO

Question asked by shekharlav on Aug 28, 2012
Latest reply on Sep 3, 2012 by larsc



I am using a ADSP BF527 based board. I am using 2011R1 HEAD distro, with 2011R1-RC4 toolchain.


The kernel I use has  drivers for AD7476 and IIO as pre-loaded module


Once my distro has booted, I do the following configurations :


echo spi0.49 > /sys/bus/spi/drivers/ad7476/unbind

echo spi0.49 > /sys/bus/spi/drivers/ad7476/bind

echo 500 > /sys/bus/iio/devices/trigger0/frequency

echo bfintmr3 > /sys/bus/iio/devices/device0/trigger/current_trigger

echo 5000 > /sys/bus/iio/devices/device0/device0:buffer0/length

echo 0 > /sys/bus/iio/devices/device0/device0:buffer0/scan_elements/timestamp_en

echo 1 > /sys/bus/iio/devices/device0/device0:buffer0/scan_elements/in0_en

echo 1 > /sys/bus/iio/devices/device0/device0:buffer0/enable

I wrote a simple code which reads data from the ring buffer and stores it to a file.


I executed my code and got some data. But once the code finished execution, the kernel crashed.


Please find attached the crash dump as crashDump3.txt


Please find attached my source code as main.c


Note : The name of the built executable is IIO_GPIO_CONN_Capture_Example_V1_0


I am not sure what went wrong since the code had already finished execution, and the control was at the console prompt.





PS : I had earlier posted this question on another ADI Forum ( and have been directed to this forum.