cancel
Showing results for 
Search instead for 
Did you mean: 

LSM6DS3 Data Ready Interrupt not triggering

RobGeografo
Associate II

Hi everyone,

I am working on a project using the SensiBLE module. It includes an STM32L476RG microcontroller and an LSM6DS3 IMU sensor. I am using I2C for communication between the two.

I am trying to enable the accelerometer data-ready interrupt on INT1 using the following setup:

CTRL1XL                  ODR = 104Hz, FS = 2G

CTRL3_C                   BDU = 1, IF_INC = 1

CTRL4_C                   INT2_on_INT1 = 1 and SLEEP_G=1

CTRL6_C                   XL_HM_MODE = 1

MASTER_CONFIG    DRDY_ON_INT1 = 1

INT1CTRL                  DRDY_XL = 1

However, the interrupt does not seem to trigger. To confirm that I would use an oscilloscope, however, the SensiBLE module is compact and I can't probe the MCU pins. However, as a test, if I replace the EXTI pin from the IMU INT1 pin with the SensiBLE button EXTI input pin and leave the I2C functions to retrieve accelerometer data from the IMU in the callback and cplt functions, it works successfully.

 

What is missing in the IMU configuration to fully enable the data-ready interrupt? Should I do it on INT2?

 

Thanks,

 

Rob

5 REPLIES 5
RobGeografo
Associate II

UPDATE:

I also tried different configurations with:

MASTER_CFG     DRDY_ON_INT1 = 0

MD1CFG               INT1_TIMER = 0 and then 1

ACC ODR = 416Hz and then 12.5Hz

However, the issue still occurs in all the various configurations used.

RobGeografo
Associate II

2nd UPDATE:

Just to test that the GPIO_EXTI pin configuration is correct, I configured the LSM6DS3 to trigger an interrupt on a single tap (following the example on AN4650 section 4.5.4) and it works successfully. Hence, there is something I misconfigured in the Data-Ready interrupt configuration.

RobGeografo
Associate II

3rd UPDATE:

Well, I found something interesting!

When I program my firmware into the STM32 chip (regardless if I use STM32CubeIDE or STM32CubeProg to program it) or when I do a HW reset the SensiBLE via the reset button on the SensiEDGE Development Board, the firmware crashes. If, instead, I power-cycle the device, the code works.

Another thing I noticed, the debugger does not work properly anymore. I can get it to start however when it runs MX_GPIO_Init() in the main.cc file the debugger loses connection with the device and stops debugging.

My theory is that the interrupt I am trying to enable is automatically triggered by the IMU sensor and if there is any timing issue it errors out. On the other side, if enable any other interrupt that triggers manually or by a movement, the code gets programmed and run correctly.

Where should I be looking to fix this issue?

I have looked at

https://stcommunity.st.com/t5/embedded-software-mcus/why-my-mcu-doesn-t-work-when-powerup-it-only-starts-code-if-i-do/m-p/384156/highlight/true#M28291

and added a delay before (or even after) SystemClock_Config() but it didn't help.

Federica Bossi
ST Employee

Hi @RobGeografo ,

Could you try to enable only DRDY on int1?

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 @Federica Bossi ,

Thank you for your reply.

I tried the just enable DRDY on int1 and it didn't work.

However, I am currently on another task and I'll continue to investigate on this when I am back on this one.

Thanks