lsm6dsox raw data

Hello!

I am using stm32 and communication over spi with lsm6dsox and reading raw data from the sensors for gyroscope and accelerometer. I m not using any library but I think the reading from my x-axis of gyroscope is wrong. Shouldn't it be all near zero when the board is calm, except the z-axis of accelerometer, This is what I get:

AccX=7 AccY=8 AccZ=16200 GyroX=1660 GyroY=10 GyroZ=9

So Im getting 1660 for gyro x-axis,is this ok?, or should it be near 0. Im not doing any calibration for gyro or setting any offset..

You must calibrate the gyro to remove the zero offsets.

The large value on the Z accelerometer axis is the acceleration due to gravity.

Thanks, I know for the accelerometer z axis.

What is the correct way to calibrate the Gyro? Is it just to subtract the raw gyro data when it's calm, to get all zeros. In the datasheet(lsm6dsox) I don't see any registers for gyro offset, there are offset register for the accelerometer, but my accelerometer is working ok.

Your program can subtract offsets. No need for the sensor to do that.

So you mean in my example to manually subtract the raw gyro data, to get all zero on all axis?, and thats the calibration for a gyroscope.

If by "manually" you mean to write code that subtracts the offsets from the raw gyro measurements, yes.