cancel
Showing results for 
Search instead for 
Did you mean: 

Hi, I'm trying to do reset set in my lsm6dsox sensor. (I use stm32wbx, stm32cubeide,bucemx) İ wrote driver functions. When iget to initialization for my single_tap api . i can not get the default value from the sensor register. what can be the reason ?

FOzat
Associate II
3 REPLIES 3
FOzat
Associate II

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;

}

FOzat
Associate II

what can i do to solve and correct the reading process and get the true value from the sensor ?

Remy ISSALYS
ST Employee

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