[LSM9DS19] Weird bahavior observed while reading WHO_AM_I register (accelerometer + Gyroscope)
Hello, everyone!
As I was following the polling example on GitHub with the STM32 drivers for the LSM9DS1. I noticed that, during the configuration, reading the Accelerometer & Gyroscope registers, the WHO_AM_I read value was 0x28h, instead of 0x68h. The reading of the magnetometer correspondent register (WHO_AM_I_M) returns the expected value(0x3Dh).
After a few tests on altering the code, I noticed that I had to read it twice in order to get a correct reading, exactly as follows:
lsm9ds1_id_t whoamI;
lsm9ds1_dev_id_get(&dev_ctx_mag, &dev_ctx_imu, &whoamI);
lsm9ds1_dev_id_get(&dev_ctx_mag, &dev_ctx_imu, &whoamI);
if (whoamI.imu != LSM9DS1_IMU_ID || whoamI.mag != LSM9DS1_MAG_ID){
while(1){
return 0;
}
}I tryed also adding a delay between the the initialization of the device and the register read process (up to 2 seconds), to no avail. Here, I was hoping that there was the need for a Boot Time in order to get a correct reading, but that seems to not be the case.
Any idea on what's causing this issue?
Thanks in advance
