cancel
Showing results for 
Search instead for 
Did you mean: 

LSM6DSV sensor hub with LIS2MDL through external trigger but don't work

NWang.1
Associate II

Hello ST guys:

We want to use LSM6DSV(IMU) with an external magnetometer(LIS2MDL) through Sensor Hub mode to gather data and place acc, gyr and mag readings in the FIFO. We want to make INT2 into an input signal which triggers the sensor hub. And we configure following registers to make START _CONFIG = 1 according to following documentation:

NWang1_0-1725590897185.png

 

sh_cfg_read.slv_add = (LIS2MDL_I2C_ADD & 0xFEU) >> 1; /* 7bit I2C address */
sh_cfg_read.slv_subadd = LIS2MDL_OUTX_L_REG;
sh_cfg_read.slv_len = 6;
lsm6dsv_sh_slv_cfg_read(&dev_ctx, 0, &sh_cfg_read);
lsm6dsv_fifo_sh_batch_slave_set(&dev_ctx, 0, PROPERTY_ENABLE);
lsm6dsv_sh_syncro_mode_set(&dev_ctx, LSM6DSV_SH_TRIG_INT2);  
lsm6dsv_sh_data_rate_set(&dev_ctx, LSM6DSV_SH_120Hz);	
lsm6dsv_sh_slave_connected_set(&dev_ctx, LSM6DSV_SLV_0_1);
lsm6dsv_sh_master_set(&dev_ctx, PROPERTY_ENABLE);

 

We also configure data ready signal on LIS2MDL:

 

lis2mdl_drdy_on_pin_set(&lis2mdl_ctx, PROPERTY_ENABLE);

 

But we don't get any external mag sensor samples from FIFO and we also use function lsm6dsv_all_int_source_get check but don't get anything. Is there any misunderstanding about the register configuration for INT2(Sensor Hub) or any good suggestions? Thank you very much.

BRs. 

 

3 REPLIES 3
Federica Bossi
ST Employee

Hi @NWang.1 ,

You can try to follow our official PID example, let me know if it helps!

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hi, Bossi,

We have followed your official PID example. In your example, the sensor hub trigger signal can be synchronized with the accelerometer/gyroscope data-ready signal (up to 480 Hz). In this configuration, the sensor hub ODR can be configured through the SHUB_ODR_[2:0] bits of the SLV0_CONFIG register. In this case, we can get mag sensor data.

But we want an external signal connected to the INT2 pin can be used as the sensor hub trigger. But after we have modified some code as above based on your official example, but we can't get mag sensor data. Thank you very much.

BRs.

Christian N
ST Employee

This post has been escalated to the ST Online Support Team for additional assistance. We'll contact you directly.