cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement the LSM9DS1 correctly with Industrial IIO without having a hardware interrupt?

GLens.1
Associate

Currently, we are using I2C from userspace to poll the LSM9DS1. However, this increases the CPU load on our device. This is why we would like to use the Industrial IO driver to reduce this impact.

We have already patched our kernel v4.14.78 with https://github.com/STMicroelectronics/STMems_Linux_IIO_drivers/tree/linux-4.14.y-gh and are able to use the IIO devices to read out the raw channels.

Now we would like to use the triggers and buffers to read out the data to be able to read out the sensor on a higher frequency. The problem is that these files/folders are missing from our sysfs.

We think this might be because we do not have a hardware interrupt available in our device tree:

&i2c1 {
	lsm9ds1@6b {
		compatible = "st,lsm9ds1";
		reg = <0x6b>;
		status = "okay";
	};
 
	lsm9ds1_magn@1e {
		compatible = "st,lsm9ds1_magn";
		reg = <0x1e>;
		status = "okay";
	};
};

Our defconfig contains the following config for IIO:

CONFIG_IIO=y
CONFIG_IIO_BUFFER_CB=y
CONFIG_IIO_SW_DEVICE=y
CONFIG_IIO_SW_TRIGGER=y
CONFIG_IIO_ST_IMU68=y
CONFIG_ST_MAG3D_IIO=y
CONFIG_IIO_HRTIMER_TRIGGER=y
CONFIG_IIO_INTERRUPT_TRIGGER=y
CONFIG_IIO_TIGHTLOOP_TRIGGER=y
CONFIG_IIO_SYSFS_TRIGGER=y

Is this why? Or are we missing something in our configuration to be able to use the buffers?

1 REPLY 1
Eleon BORLINI
ST Employee

Hi @GLens.1​ ,

You should find the industrial LinuxDriverIIO configurations in the iio folder, in particular in the industrialio-core.c. However, I'm not sure that the LSM9DS1 part number is supported there...

You may open a request for LSM9DS1 industrial IIO drivers directly on that Github section (that is managed by ST employees), for a more specific support.

-Eleon