Skip to main content
IAdam
Visitor II
March 19, 2019
Question

LSM6DSOX - DRDY Interrupt

  • March 19, 2019
  • 2 replies
  • 1006 views

I have an LSM6DSOX on a STEVAL-MKI197V1 on a breadboard. I am able to communicate with the device (reading device ID returns the correct value, all driver calls return 0), but I am not getting an interrupt generated on either INT1 or INT2. I'm using the following to initialize the sensor. Any help that anyone could provide would be greatly appreciated. The following code is based on the ST example, read_data_interrupt.c.

bool lsm6dsox_Init(lsm6dsox_ctx_t* ctx)
{
 ctx->read_reg = platform_read;
 ctx->write_reg = platform_write;
 
 uint8_t devId = 0;
 uint8_t rst = 0;
 lsm6dsox_pin_int1_route_t int1_route;
 int ret = 0;
 
 // Reset device
 ret |= lsm6dsox_reset_set(ctx, PROPERTY_ENABLE);
 do {
 ret |= lsm6dsox_reset_get(ctx, &rst);
 } while (rst);
 
 // Disable I3C interface
 ret |= lsm6dsox_i3c_disable_set(ctx, LSM6DSOX_I3C_DISABLE);
 
 // Enable block update
 ret |= lsm6dsox_block_data_update_set(ctx, PROPERTY_ENABLE);
 
 // Set data rate
 ret |= lsm6dsox_xl_data_rate_set(ctx, LSM6DSOX_XL_ODR_12Hz5);
 ret |= lsm6dsox_gy_data_rate_set(ctx, LSM6DSOX_GY_ODR_12Hz5);
 
 // Set capture scale
 ret |= lsm6dsox_xl_full_scale_set(ctx, LSM6DSOX_8g);
 ret |= lsm6dsox_gy_full_scale_set(ctx, LSM6DSOX_2000dps);
 
 ret |= lsm6dsox_data_ready_mode_set(ctx, LSM6DSOX_DRDY_LATCHED);
 
 // Interrupt generation routed on DRDY INT1 pin
 ret |= lsm6dsox_pin_int1_route_get(ctx, &int1_route);
 int1_route.int1_ctrl.int1_drdy_g = PROPERTY_ENABLE;
 int1_route.int1_ctrl.int1_drdy_xl = PROPERTY_ENABLE;
 ret |= lsm6dsox_pin_int1_route_set(ctx, &int1_route);
 
 // Get device ID
 ret |= lsm6dsox_device_id_get(ctx, &devId);
 
 return (devId == LSM6DSOX_ID && ret == 0);
}

This topic has been closed for replies.

2 replies

azmat.bilal
Associate II
August 5, 2019

was able to solve my problem. the STEVAL-MKI109V3 firmware was outdated. earlier i tried to update its firmware but the GUI of the DFU tool didnt have a good UX (as highlighted in the image). so instead of updating the firmware i overwrote the firmware file with the old firmware image from the STEVAL-MKI109V3. as a result everytime i tried to update the image properly it would write back the old image. 0690X000009841BQAQ.png

azmat.bilal
Associate II
August 5, 2019

sorry answered in the wrong post.