This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM3358: iio_generic_buffer usage

Part Number: AM3358

Tool/software: Linux

Hello,

On my board, based on AM3358 and linux-rt-4.9.69+gitAUTOINC+7069a470d5-g7069a470d5, I have connected via I2C an accelerometer MPU6050.

In /dev I can see the device : iio:device0, and in  /sys/bus/iio/devices/iio:device0 I have all the expected files:

drwxr-xr-x 2 root root 0 Jul 30 11:15 buffer
-rw-r--r-- 1 root root 4096 Jul 30 11:15 current_timestamp_clock
-r--r--r-- 1 root root 4096 Jul 30 11:15 dev
-r--r--r-- 1 root root 4096 Jul 30 11:15 in_accel_matrix
-r--r--r-- 1 root root 4096 Jul 30 11:15 in_accel_mount_matrix
-rw-r--r-- 1 root root 4096 Jul 30 11:15 in_accel_scale
-r--r--r-- 1 root root 4096 Jul 30 11:15 in_accel_scale_available
-rw-r--r-- 1 root root 4096 Jul 30 11:15 in_accel_x_calibbias
-rw-r--r-- 1 root root 4096 Jul 30 11:15 in_accel_x_raw
-rw-r--r-- 1 root root 4096 Jul 30 11:15 in_accel_y_calibbias
-rw-r--r-- 1 root root 4096 Jul 30 11:15 in_accel_y_raw
-rw-r--r-- 1 root root 4096 Jul 30 11:15 in_accel_z_calibbias
-rw-r--r-- 1 root root 4096 Jul 30 11:15 in_accel_z_raw
-r--r--r-- 1 root root 4096 Jul 30 11:15 in_anglvel_mount_matrix
-rw-r--r-- 1 root root 4096 Jul 30 11:15 in_anglvel_scale
-r--r--r-- 1 root root 4096 Jul 30 11:15 in_anglvel_scale_available
-rw-r--r-- 1 root root 4096 Jul 30 11:15 in_anglvel_x_calibbias
-rw-r--r-- 1 root root 4096 Jul 30 11:15 in_anglvel_x_raw
-rw-r--r-- 1 root root 4096 Jul 30 11:15 in_anglvel_y_calibbias
-rw-r--r-- 1 root root 4096 Jul 30 11:15 in_anglvel_y_raw
-rw-r--r-- 1 root root 4096 Jul 30 11:15 in_anglvel_z_calibbias
-rw-r--r-- 1 root root 4096 Jul 30 11:15 in_anglvel_z_raw
-r--r--r-- 1 root root 4096 Jul 30 11:15 in_gyro_matrix
-rw-r--r-- 1 root root 4096 Jul 30 11:15 in_temp_offset
-rw-r--r-- 1 root root 4096 Jul 30 11:15 in_temp_raw
-rw-r--r-- 1 root root 4096 Jul 30 11:15 in_temp_scale
-r--r--r-- 1 root root 4096 Jul 30 11:15 name
lrwxrwxrwx 1 root root 0 Jul 30 11:15 of_node -> ../../../../../../../firmware/devicetree/base/ocp/i2c@4802a000/inv-mpu6050@68
drwxr-xr-x 2 root root 0 Jul 30 11:15 power
-rw-r--r-- 1 root root 4096 Jul 30 11:15 sampling_frequency
-r--r--r-- 1 root root 4096 Jul 30 11:15 sampling_frequency_available
drwxr-xr-x 2 root root 0 Jul 30 11:15 scan_elements
lrwxrwxrwx 1 root root 0 Jan 1 1970 subsystem -> ../../../../../../../bus/iio
drwxr-xr-x 2 root root 0 Jul 30 11:15 trigger
-rw-r--r-- 1 root root 4096 Jan 1 1970 uevent

In the file _raw I can find correct values. But when I try to access these data via iio_generic_buffer I cannot see any data:

root@am335x-evm:~# ./iio_generic_buffer -a -N 0 -t mpu6050-dev0
iio device number being used is 0
iio trigger number being used is 0
No channels are enabled, enabling all channels
Enabling: in_accel_y_en
Enabling: in_anglvel_z_en
Enabling: in_accel_x_en
Enabling: in_timestamp_en
Enabling: in_anglvel_y_en
Enabling: in_accel_z_en
Enabling: in_anglvel_x_en
/sys/bus/iio/devices/iio:device0 mpu6050-dev0

^c


Caught signal 2
Disabling: in_accel_y_en
Disabling: in_anglvel_z_en
Disabling: in_accel_x_en
Disabling: in_timestamp_en
Disabling: in_anglvel_y_en
Disabling: in_accel_z_en
Disabling: in_anglvel_x_en

There are some settings I miss in order to use iio_generic_buffer?

Thanks