Skip to main content
Visitor II
January 16, 2018
Question

LSM6DSL sensor hub with LIS2MDL

  • January 16, 2018
  • 3 replies
  • 1496 views
Posted on January 16, 2018 at 09:17

Hello,

I'm using LSM6DSL in sensor hub mode with LIS2MDL, using the example in IKS01A2 I have managed to activate the LIS2MDL and read data from it.

My current issue is that I can't put the LIS2MDL in low power mode, I tried using 'LSM6DSL_ACC_GYRO_SH0_WriteByte' function but it get stuck in the while loop waiting for 'LSM6DSL_ACC_GYRO_SENS_HUB_END_OP_COMPLETED'

Can you please assist?

Thank you,

Michael

    This topic has been closed for replies.

    3 replies

    ST Employee
    January 17, 2018
    Posted on January 17, 2018 at 15:46

    Do you think you can share the whole project?

    privenAuthor
    Visitor II
    January 17, 2018
    Posted on January 17, 2018 at 19:21

    Hi,

    Unfortunately I can't share the project, but I have use the sensor hub example from 

    IKS01A2 SDK without any changes, and for the LIS2MDL idle command i use - 'LSM6DSL_ACC_GYRO_SH0_WriteByte(LSM6DSL_X_0_handle, LIS2MDL_MAG_I2C_ADDRESS, LIS2MDL_MAG_CFG_REG_A, LIS2MDL_MD_IDLE) != MEMS_SUCCESS'

    January 17, 2018
    Posted on January 17, 2018 at 16:08

    My guess is that there is not a correct I2C connection between the master and slave devices and the function hangs, because it doesn't get an ACK from the slave sensor.

    Are you sure that the devices are properly connected, with pull-ups to Vcc? Do you have a possibility to check the logic levels of the I2C communication (using a logic analyzer)? Schematics of your HW could also help with a diagnose.

    Also, check whether you use the correct I2C addresses of the sensors.

    ST Employee
    January 17, 2018
    Posted on January 17, 2018 at 16:13

    Koudela.David

    ‌ I don't think so, because Michael wrote '

    I have managed to activate the LIS2MDL and read data from it' so he is able to read data from the magnetometer using LSM6DSL as sensor hub. I don't expect any issue with I2C address or connection. But this feature is quite complex and some operations can be tricky.

    privenAuthor
    Visitor II
    January 18, 2018
    Posted on January 18, 2018 at 10:24

    Update:

    I can enter the LIS2MDL to idle mode, but now I cant restart it