2022-10-11 1:29 AM - last edited on 2026-03-23 3:53 AM by Andrew Neil
Hi,
I'm trying to do reset set in my lsm6dsox sensor. (I use stm32wbx, stm32cubeide,bucemx)
İ wrote driver functions.
When i get to initialization for my single_tap api . i can not get the default value from the sensor register.
what can be the reason ?
2022-10-11 1:30 AM - last edited on 2026-03-23 3:53 AM by Andrew Neil
int32_t lsm6dsox_reset_set(I2C_HandleTypeDef *i2c, uint8_t val)
{
lsm6dsox_ctrl3_c_t ctrl3_c;
uint8_t ret;
ret = lsm6dsox_read_reg(i2c,LSM6DSOX_READ, LSM6DSOX_CTRL3_C, (uint8_t *)&ctrl3_c, 1); // i canot read the default register value (0x04).
if(ret==0)
{
ctrl3_c.sw_reset = (uint8_t)val;
ret = lsm6dsox_write_reg(i2c,LSM6DSOX_WRITE, LSM6DSOX_CTRL3_C, (uint8_t *)&ctrl3_c, 1);
}
return ret;
}
2022-10-11 1:31 AM
what can i do to solve and correct the reading process and get the true value from the sensor ?
2022-11-07 6:47 AM
Hello,
You can look this post to see example using lsm6dsox sensor maybe it can help you to find the root cause of your issue.
Best Regards
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.