Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to create iio buffer #941

Open
panxishan opened this issue Feb 24, 2023 · 3 comments
Open

Failed to create iio buffer #941

panxishan opened this issue Feb 24, 2023 · 3 comments

Comments

@panxishan
Copy link

Via iio_ device_ create_ Buffer () creates a buffer to read the information of the gyroscope's iio device. There is a segment error, error code 22. What is the reason

@pcercuei
Copy link
Contributor

Error code 22 is "invalid value". What hardware and Linux driver are you using, and how do you call iio_device_create_buffer?

@panxishan
Copy link
Author

Error code 22 is "invalid value". What hardware and Linux driver are you using, and how do you call iio_device_create_buffer?

I wrote an iio driver test for mpu6050 and created a buffer in qt through the (struct iio_buffer * buf=iio_device_create_buffer (dev, 1024, false) function

@pcercuei
Copy link
Contributor

pcercuei commented Mar 1, 2023

I would think that your mpu6050 driver does not support the buffer interface. It does not really need to, if the sample rate is very low (which is typically the case on a gyroscope).

Instead, you should be able to use channel.find_attribute("raw").read() to get a snapshot of the channel's value at a given time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants