2024-12-27 12:18 AM
We are using the X-STM32MP-GNSS2 (with the STM32 discovery board DK2), which has ISM330DHCX IMU. The accelerometer readings seem fine from the IMU, but the gyroscope gives enormously high and varying readings even when we are stationary. See below the varying output from the gyro
root@FAFUSION:/sys/bus/iio/devices/iio:device2# ls
buffer in_anglvel_x_raw sampling_frequency
buffer0 in_anglvel_y_raw sampling_frequency_available
current_timestamp_clock in_anglvel_z_raw scan_elements
dev name subsystem
in_anglvel_scale of_node uevent
in_anglvel_scale_available power waiting_for_supplier
root@FAFUSION:/sys/bus/iio/devices/iio:device2# cat name
ism330dhcx_gyro
root@FAFUSION:/sys/bus/iio/devices/iio:device2# cat sampling_frequency
833.000000
root@FAFUSION:/sys/bus/iio/devices/iio:device2# cat in_anglvel_scale
0.000152716
root@FAFUSION:/sys/bus/iio/devices/iio:device2# cat in_anglvel_x_raw in_anglvel
_y_raw in_anglvel_z_raw
-19111
11246
-3500
root@FAFUSION:/sys/bus/iio/devices/iio:device2# cat in_anglvel_x_raw in_anglvel
_y_raw in_anglvel_z_raw
-18835
15691
-4096
root@FAFUSION:/sys/bus/iio/devices/iio:device2#
root@FAFUSION:/sys/bus/iio/devices/iio:device2# cat in_anglvel_x_raw in_anglvel
_y_raw in_anglvel_z_raw
-19119
-22581
-10041
root@FAFUSION:/sys/bus/iio/devices/iio:device2# cat in_anglvel_x_raw in_anglvel
_y_raw in_anglvel_z_raw
-19194
16978
-4096
root@FAFUSION:/sys/bus/iio/devices/iio:device2#
Also, the scale here does not seem correct. For a 16-bit 2s-complement max of 32767 and a scaling factor of 0.000152716, the full-scale range is 32767 x 0.000152716 = 5 degrees/sec, which is not what the datasheet says. I would expect this to be 125 dps.