Re: Use LIS3MDL with LSM6DSM sensor-hub

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020-03-19 21:49, Lorenzo Bianconi wrote:
On 2020-03-19 18:40, Lorenzo Bianconi wrote:
On 2020-03-14 13:43, Lorenzo Bianconi wrote:
On Mar 11, Jimmy Assarsson wrote:
Hi,


[...]

Hi Jimmy,

in order to set the full scale on LIS3MDL you can try the following patch (just
compiled, not tested)

Regards,
Lorenzo

Hi Lorenzo,

Sorry for the late response and thanks for the patch!

Hi Jimmy,

ok, I will post the patch, thx for testing.

Great, you can add
Tested-by: Jimmy Assarsson <jimmyassarsson@xxxxxxxxx>

The patches seems to work.
Are there any specific tests that we should carry out?
Via the sysfs interface, we've tested reading raw values of each channel and
configuring ODR and full scale.

you can try to enable batching in the hw FIFO doing something like:

$echo 1 > /sys/bus/iio/devices/<iio-magn>/scan_elements/in_magn_x_en
$echo 1 > /sys/bus/iio/devices/<iio-magn>/scan_elements/in_magn_y_en
$echo 1 > /sys/bus/iio/devices/<iio-magn>/scan_elements/in_magn_z_en
$echo 1 > /sys/bus/iio/devices/<iio-magn>/scan_elements/in_timestamp_en

$watermark=64
$echo $((2*watermark)) > /sys/bus/iio/devices/<iio-magn>/buffer/length
$echo $watermark > /sys/bus/iio/devices/<iio-magn>/buffer/watermark

$generic_buffer -gn lsm6dsm_magn -c <# of samples>

Ok. I don't got any scan_elements nor buffer directory, for any of the devices.
I guess it is not possible to use the FIFO without configuring any interrupt?
We got the following dts:
&spi1 {
	#address-cells = <1>;
	#size-cells = <0>;
	lsm6dsm@0 {
		compatible = "st,lsm6dsm";
		reg = <0x0>;

		spi-max-frequency = <500000>;
		st,pullups = "true";

yes, you need to provide the interrupt line doing something like (this is from
the dts on my rpi):

	lsm6dsm@0 {
		...
		interrupt-parent = <&gpio>;
		interrupts = <21 0x4>;
		...
	};

	};
};

I'll look into this tomorrow or in the beginning of next week, thanks for the help.

Now I've tested this. It looks fine, except for the very first sample:
$ ./iio_generic_buffer -gn lsm6dsm_magn -c 1
iio device number being used is 3
trigger-less mode selected
-3.250836 -2.796192 10.212408 1584976428879020199
1.893036 2.343738 -0.853224 1584976428917070199
1.888218 2.343300 -0.852786 1584976428955095199
1.888218 2.343300 -0.852786 1584976428993145199
1.889532 2.345490 -0.851472 1584976429031170199

Is this expected?

Regards,
jimmy



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux