Comments (12)
Hi,
the LSM6DSX driver in kernel mainline is supported by Linux community. It manage trigger events on FIFO through an hw IRQ line so you need to configure an interrupt line in your device tree. Something like that (this work for rpi 4, address 0x6b depends on SDA0):
ism330dlc: ism330dlc@6b { compatible = "st,ism330dlc"; reg = <0x6b>; interrupt-parent = <&gpio>; interrupts = <26 IRQ_TYPE_LEVEL_HIGH>; st,int-pin = <1>; };
This is the solution we suggested 2 weeks ago.
This is an off topic thread because the driver you mention is not in this repository being it maintained by Linux community. If you need more support on our products you are kindly invited to reach us on offical support
from st-mems-android-linux-drivers-iio.
@lukasl277 I'm try to do exactly the same thing. Do you ever find a solution?
from st-mems-android-linux-drivers-iio.
Hi,
the LSM6DSX driver in kernel mainline is supported by Linux community. It manage trigger events on FIFO through an hw IRQ line so you need to configure an interrupt line in your device tree. Something like that (this work for rpi 4, address 0x6b depends on SDA0):
ism330dlc: ism330dlc@6b {
compatible = "st,ism330dlc";
reg = <0x6b>;
interrupt-parent = <&gpio>;
interrupts = <26 IRQ_TYPE_LEVEL_HIGH>;
st,int-pin = <1>;
};
from st-mems-android-linux-drivers-iio.
That is infact just what I have
lsm6dso@6a {
compatible = "st,lsm6dso";
reg = <0x6a>;
interrupt-parent = <&gpio>;
interrupts = <22 2>, <27 2>; // IRQ_TYPE_EDGE_FALLING
st,drdy-int-pin = <1>;
};
When I try to read the device it is incredibly slow and and creating iio_buffers or triggers always fails to init
from st-mems-android-linux-drivers-iio.
I found out that you can't use the iio-trigger directory because there is none. So what you have to do is modprobe an hw trigger and an iio buffer have the right interrupt pins configured in your DT and enable your the buffer and channels later on in your iio-device directory. Then if u look in the /dev/i2c-x file there should be data coming in caused by the HW trigger.
from st-mems-android-linux-drivers-iio.
Thank @lukasl277 this what I tried but the buffer creation and assigning the trigger to the devices still fails in code
RCLCPP_INFO(get_logger(), "* Acquiring device %s", device.c_str());
iio_device *dev = iio_context_find_device(ctx, device.c_str());
if (!dev) {
RCLCPP_ERROR(get_logger(), "Could not find %s device", device.c_str());
continue;
}
sensor.dev_name = device.c_str();
sensor.device = dev;
RCLCPP_INFO(get_logger(), "* Initialising IIO streaming channels:");
std::ostringstream log_msg;
log_msg << " ";
for (unsigned int i = 0; i < iio_device_get_channels_count(dev); ++i) {
struct iio_channel *chn = iio_device_get_channel(dev, i);
if (iio_channel_is_scan_element(chn)) {
log_msg << iio_channel_get_id(chn) << ", ";
sensor.channel_count++;
}
}
RCLCPP_INFO(get_logger(), log_msg.str().c_str());
if (sensor.channel_count == 0) {
RCLCPP_ERROR(get_logger(), "No scan elements found in device");
continue;
}
sensor.channels = (iio_channel **)calloc(sensor.channel_count, sizeof *sensor.channels);
if (!sensor.channels) {
RCLCPP_ERROR(get_logger(), "Channel array allocation failed");
continue;
}
for (unsigned int i = 0; i < sensor.channel_count; ++i) {
struct iio_channel *chn = iio_device_get_channel(sensor.device, i);
if (iio_channel_is_scan_element(chn))
sensor.channels[i] = chn;
}
sensor.trigger_name = trigger.c_str();
RCLCPP_INFO(
get_logger(), "* Acquiring trigger %s for device: %s", trigger.c_str(), device.c_str());
sensor.trigger = iio_context_find_device(ctx, sensor.trigger_name);
if (!sensor.trigger || !iio_device_is_trigger(sensor.trigger)) {
RCLCPP_ERROR(get_logger(), "No trigger found (try setting up the iio-trig-hrtimer module)");
continue;
}
RCLCPP_INFO(get_logger(), "* Enabling IIO streaming channels for buffered capture");
for (unsigned int i = 0; i < sensor.channel_count; ++i) {
iio_channel_enable(sensor.channels[i]);
}
RCLCPP_INFO(get_logger(), "* Enabling IIO buffer trigger");
if (iio_device_set_trigger(sensor.device, sensor.trigger)) {
RCLCPP_ERROR(get_logger(), "Could not set trigger");
continue;
}
RCLCPP_INFO(get_logger(), "* Creating non-cyclic IIO buffers with %d samples", BUFFER_LENGTH);
sensor.buffer = iio_device_create_buffer(sensor.device, BUFFER_LENGTH, false);
if (!sensor.buffer) {
RCLCPP_ERROR(get_logger(), "Could not create buffer");
continue;
}
}
from st-mems-android-linux-drivers-iio.
I found that this book helped me understand the iio framework more https://www.oreilly.com/library/view/linux-device-drivers/9781785280009/42be7f96-325c-423b-96ab-ceeddeb753c9.xhtml
You just have to accept the free trial. I covers basically everything around the topic. Sadly I don't know how else to help you. The only thing that could be of possibility is that you have the wrong i2c bus and interrupt pin configured in your DTS overlay.
from st-mems-android-linux-drivers-iio.
@rosterloh Did you manage to find a solution to this issue? I am facing the same issue.
from st-mems-android-linux-drivers-iio.
@sunny52266 I did not I'm afraid. My solution currently is to replace the IMU with one from a different vendor
from st-mems-android-linux-drivers-iio.
@rosterloh I found the solution. Apparently you need to configure the interrupts for the driver to be able to configure buffers and scan elements. otherwise it shows up as we were experiencing.
from st-mems-android-linux-drivers-iio.
Thanks @sunny52266 but as you can see from my post above on 2nd of Feb I've already configured the interrupts
from st-mems-android-linux-drivers-iio.
You have configured st,drdy-pin as per your post. Please also ensure if pin 26 of &gpio is connected to a gpio expander, you need to enable its interrupts too and config that as interrupt controller and define its int pin. Also pl follow:
Hi,
the LSM6DSX driver in kernel mainline is supported by Linux community. It manage trigger events on FIFO through an hw IRQ line so you need to configure an interrupt line in your device tree. Something like that (this work for rpi 4, address 0x6b depends on SDA0):ism330dlc: ism330dlc@6b { compatible = "st,ism330dlc"; reg = <0x6b>; interrupt-parent = <&gpio>; interrupts = <26 IRQ_TYPE_LEVEL_HIGH>; st,int-pin = <1>; };
This is the solution we suggested 2 weeks ago.
This is an off topic thread because the driver you mention is not in this repository being it maintained by Linux community. If you need more support on our products you are kindly invited to reach us on offical support
from st-mems-android-linux-drivers-iio.
Related Issues (19)
- lsm9ds1 (st_imu68) irq not triggered on data ready HOT 1
- Update patch to support Linux Kernel 6.1?
- ASM330LHH IIO driver on kernel 5.10 HOT 1
- Updated driver AIS2IHTR to read temperature register HOT 1
- Licensing HOT 2
- How to Stabilize Sensor Output and Achieve Target Frequency for asm330lhhxg1 and lsm6dsox? HOT 1
- Power up fail for lis2dux12/lis2duxs12 HOT 2
- Enable Wake-up interrupt with lsm6dsox driver and lsm6dso MEMS.
- git merge --no-fork-point is unknown option HOT 1
- LIS2DUX12/LIS2DUXS12 driver create badly named event files HOT 1
- Support of LSM6DSV16X HOT 1
- compilation of st_lis2dw12_buffer.c with kernel 5.15 fails HOT 4
- IIS3DWB vibration sensor support HOT 1
- LSM6DSO iio errors HOT 2
- Correct way to implement accel/gyro thresholds on lsm9ds1
- Slow when keep read value? HOT 3
- Support for sensor hub on LSM6DSM HOT 1
- How come the max ODR doesn't match that of the datasheet? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from st-mems-android-linux-drivers-iio.