All of lore.kernel.org
 help / color / mirror / Atom feed
* Question about BMI160 drivers (Xilinx)
@ 2021-07-05 15:11 Lotfi FEJRI
  2021-07-05 15:13 ` Lotfi FEJRI
  0 siblings, 1 reply; 3+ messages in thread
From: Lotfi FEJRI @ 2021-07-05 15:11 UTC (permalink / raw)
  To: linux-iio

[-- Attachment #1: Type: text/plain, Size: 849 bytes --]

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

[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 8137 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Question about BMI160 drivers (Xilinx)
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Lotfi FEJRI @ 2021-07-05 15:13 UTC (permalink / raw)
  To: linux-iio

[-- Attachment #1: Type: text/plain, Size: 1019 bytes --]

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

[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 19391 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Question about BMI160 drivers (Xilinx)
  2021-07-05 15:13 ` Lotfi FEJRI
@ 2021-07-06  8:26   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2021-07-06  8:26 UTC (permalink / raw)
  To: Lotfi FEJRI; +Cc: linux-iio

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-06  8:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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.