On Mon, 5 Jul 2021 17:13:44 +0200 Lotfi FEJRI <fejri.lotfi@xxxxxxxxx> wrote: > Le lun. 5 juil. 2021 à 17:11, Lotfi FEJRI <fejri.lotfi@xxxxxxxxx> a écrit : > > > > Hello, > > > > I am trying to run your BMI160 (available on the Xilinx github) on the > > Xilinx ZedBoard, through I2C. > > I'm able to build the drivers with Petalinux (v2019.1) and to run > > (modprobe ***.ko) them without issues on the ZedBoard: > > > > - bmi160_core.ko > > - bmi160_i2c.ko > > - bmi160_spi.ko > > > > > > > > here is the device-tree I added for the sensor: > > > > > > > > > > When I run "i2cdetect -y -r 0" I can see that the device and the i2c > > interface is recognized. I can see "UU" inside 0x68 (which seems to be > > the I2C address), nothing more than this. > > > > My question is: How is it possible to read and save the data in a txt > > file? I don't see which function I have to call to read the data. > > The only one related to getting the data is "bmi160_get_data" from > > bmi160_core.c but I don't know how to call this function... > > > > Please, can you help me on this? > > > > Thank you! > > > > Kind regards, > > > > Lotfi > Images are going to reach the list, so stick to text. Do you have any indication the driver successfully bound to the device? Look to see what you have in /sys/bus/iio/devices/ If the driver is connected you can just cat from the relevant files under the deviceX directory. Interrupt driven approaches also possible. Take a look at the tools under tools/iio/ in the kernel source tree. The generic buffer code should dump a pretty formatted version of what is being read form the device and you can pipe that to a file. Jonathan