cancel
Showing results for 
Search instead for 
Did you mean: 

LSM6DSOX MLC issue

Bassem54
Visitor

I am using the MLC of the LSM6DSOX along with the Nucleo-L432KC. I am using the .h file generated from the examples provided by ST (STMems_Machine_Learning_Core\application_examples\lsm6dsox\Motion_intensity\lsm6dsox_motion_intensity).

uint8_t LSM6DSOX_MLC_config(LSM6DSOX_HandleTypeDef *LSM6DSOX, I2C_HandleTypeDef *hi2c)
{
    uint8_t ret = 0;
    for (uint32_t i = 0; i < sizeof(lsm6dsox_motion_intensity)/sizeof(ucf_line_t); i++) 
    {
        ret = HAL_I2C_Mem_Write(hi2c, LSM6DSOX_I2C_ADDR,
                lsm6dsox_motion_intensity[i].address,
                I2C_MEMADD_SIZE_8BIT,
                (uint8_t *)&lsm6dsox_motion_intensity[i].data,
                1, HAL_MAX_DELAY);
    }
    return ret;
}

In the main loop, I check the value of MLC0_SRC 

LSM6DSOX_ReadRegister(&LSM6DSOX, 0x70, &gesture);

However, the value is always 0. I also tried reading it in other ways. The sensor is working, as I can successfully read data from the accelerometer and gyroscope after configuring the MLC. I also tried other examples, such as lsm6dsox_tilt_angle_mode0, but I encountered the same issue no output from the MLC.

0 REPLIES 0