I have reused the BMI160 and BMM150 drivers to get some data from the BMX160. Accel and gyro look to work fine (I mean I get meaningful values will I rotate/move the sensor) but I am not sure about the magnetometer. These are some sample measurements (all values are in LSB)
In order to confirm that all sensor works normally, I've called the bmi160_perform_self_test() and bmm150_perform_self_test() functions.
Accel and gyro perform successfully self-test but magnetometer doesn't. It returns error code 2 which means "BMM150_E_DEV_NOT_FOUND". This is awkward since I am able to receive data before calling the self-test function (as you can see from the image above). Also after calling the bmm150_perform_self_test() function the magnetometer "freezes" (it continuously showing the same values) and I have to restart the board by cutting the power off.
Any suggestion? Maybe this is a bug of the bmm150 driver?