From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Lotfi FEJRI <fejri.lotfi@gmail.com>
Cc: <linux-iio@vger.kernel.org>
Subject: Re: Question about BMI160 drivers (Xilinx)
Date: Tue, 6 Jul 2021 09:26:17 +0100 [thread overview]
Message-ID: <20210706092617.00007406@Huawei.com> (raw)
In-Reply-To: <CAH-J=mcEQAbVtFoe8vvw-38dDZi_1=AHaA==+GN-=u_0gvfSug@mail.gmail.com>
On Mon, 5 Jul 2021 17:13:44 +0200
Lotfi FEJRI <fejri.lotfi@gmail.com> wrote:
> Le lun. 5 juil. 2021 à 17:11, Lotfi FEJRI <fejri.lotfi@gmail.com> 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
prev parent reply other threads:[~2021-07-06 8:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-05 15:11 Question about BMI160 drivers (Xilinx) Lotfi FEJRI
2021-07-05 15:13 ` Lotfi FEJRI
2021-07-06 8:26 ` Jonathan Cameron [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210706092617.00007406@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=fejri.lotfi@gmail.com \
--cc=linux-iio@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.