cancel
Showing results for 
Search instead for 
Did you mean: 

libiio and st_imu68 software hrtimer?

TDebl
Associate

I compiled the st_imu68_i2c driver for use with a 4.14 linux kernel with the industrial IO subsystem successfully. And I could read values from the device using the files that provide the "raw" values. However, it is very slow when I just cat the raw values very fast. Normally, in IIO you can define a hrtimer with scan_elements, but the iio device you get from the linux driver does not contain such a 'scan_elements' subdir so it seems I can't attach a hrtimer trigger to it. However, there is a sample_frequency file, but not clear to me what this then does or how it is supposed to work. Is there maybe a high level overview documentation somewhere of how you can get the values faster?

1 REPLY 1
BNewl.1
Associate

I've also found that using the sysfs files to read the iio data is quite slow. Especially since I'm using the LSM6DSO IMU chip and am interested in getting the X,Y,Z values for both the accelerometer and the gyroscope. This requires opening six different files, reading their values, and then closing them. Doing this even once a second is cumbersome and introduces a noticeable slowdown in the system.

Reading from the character iio device doesn't look to be supported by the driver, as you mention.

The sampling frequency will increase the number of readings output by the chip per second. It helps a little bit to increase this, but not enough in my experience.

I plan to read from the registers directly using the I2C interface which should be much faster.