Issue with IMU Sensor (LSM6DSV16X) Sample Rate in Sensor Hub Mode

I am using an IMU sensor in sensor hub mode (LSM6DSV16X, LIS2MDL) with the FIFO interrupt interval set at 30 Hz. The data is sent over BLE. It works perfectly when using RTT, but when I disable debug mode, the sample rate drops to around 1 Hz.

Could someone please help me resolve this issue?

Thank you.

Parents
  • Thank you for your reply. When the IMU's FIFO is full, an interrupt will occur on the interrupt pin. The interrupt rate will decrease to 1 Hz as if something changes or is missed when I disable the RTT configuration.

  • So what triggers the IMU readings in the first place? Do you have a timer set up at 30Hz or something?

    What HW are you running this on? nRF5340DK? Or do you have a custom board?

  • I don't know what the IMU's INT2 is used for. I assume it is an interrupt pin, but what do you mean by "doesn't work"? Does it not trigger, or does the nRF not detect it?

    Best regards,

    Edvin

  • Sorry for the confusion. INT1 and INT2 are the interrupts of the IMU. INT1 triggers the nRF whenever the IMU's FIFO is full, and INT2 is for special actions, such as a tap or a free fall. Here is the entire situations' conclusion:

    1. In the original code where I first encountered the problem, the system worked perfectly with RTT, but when RTT was disconnected, there was a timing delay.
    2. After applying your provided changes, the timing issue was resolved. However, the IMU couldn't trigger the interrupt on the nRF.
      CONFIG_LOG_MODE_DEFERRED=n
      CONFIG_LOG_MODE_IMMEDIATE=n
    3. I have modified the overlay through trial and error. Now, INT1 (FIFO overflow) triggers correctly, but INT2 remains high and doesn't trigger.
      CONFIG_RTT_CONSOLE=n
      CONFIG_LOG_BACKEND_RTT=n

    Additionally, I was wondering what might be changing here. I am confident that the IMU's code is correct, as it works in my original code (the one with the timing delay and RTT connected). However, things go wrong when I change the logging configuration in the overlay file. When I observe the signals on the logic analyzer, it seems like the IMU initializes but then stops functioning.

    Thank you,

  • It seems I may have accidentally closed the ticket. I want to make sure my issue is still being considered.

    Thank you

  • Hi Saeed,

    Advin is out-of-office, and I will be with you for now.

    I see that there has been a lot of communication and also the nature of question has been changed.

    Could you summarize the current situation and the code and the setup (connections and measurements), and how can I reproduce it?

    You have mentioned that "things go wrong when I change the logging configuration in the overlay file". Can you show both overlays and describe behaviors? Showing any output / logs would also be helpful.

    Regards,
    Naeem

  • Hi Naeem,

    I appreciate your consideration.

    This project involves receiving data from the IMU and ADC and transferring it via BLE. The IMU has two interrupts: INT1 for FIFO ready and INT2 for special events like taps.

    INT1 should trigger approximately every 10 ms, which it does when the RTT is connected. However, when I disconnect RTT, the trigger time significantly increases to around 170 ms. This is with the first overlay-debug.conf configuration.

    I followed Edvin's advice and changed the overlay-debug.conf. After the IMU initialization, neither INT1 nor INT2 triggered, and the IMU shut down.

    CONFIG_LOG=y
    CONFIG_LOG_MODE_DEFERRED=n
    CONFIG_LOG_MODE_IMMEDIATE=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=n
    CONFIG_RTT_CONSOLE=y
    CONFIG_LOG_BACKEND_RTT=y
    CONFIG_LOG_BACKEND_UART=n
    CONFIG_LOG_PRINTK=n
    
    # Troubleshooting
    CONFIG_ASSERT=y
    CONFIG_RESET_ON_FATAL_ERROR=n
    
    
    CONFIG_MAIN_THREAD_PRIORITY=8

    I then applied the following configuration, which allows INT1 to trigger on time even when RTT is disconnected. However, INT2 does not trigger and remains inactive.

    CONFIG_LOG=y
    CONFIG_LOG_MODE_DEFERRED=n
    CONFIG_LOG_MODE_IMMEDIATE=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=n
    CONFIG_RTT_CONSOLE=n
    CONFIG_LOG_BACKEND_RTT=n
    CONFIG_LOG_BACKEND_UART=n
    CONFIG_LOG_PRINTK=n
    
    # Troubleshooting
    CONFIG_ASSERT=y
    CONFIG_RESET_ON_FATAL_ERROR=n
    
    
    CONFIG_MAIN_THREAD_PRIORITY=8

    I don't believe the issue lies with the IMU itself, as the only changes I made were to the overlay-debug.conf.

    You canjust download the latest file that I uploaded here and build. Please note that the SDK version is v2.5.2.

    Thank you,

Reply
  • Hi Naeem,

    I appreciate your consideration.

    This project involves receiving data from the IMU and ADC and transferring it via BLE. The IMU has two interrupts: INT1 for FIFO ready and INT2 for special events like taps.

    INT1 should trigger approximately every 10 ms, which it does when the RTT is connected. However, when I disconnect RTT, the trigger time significantly increases to around 170 ms. This is with the first overlay-debug.conf configuration.

    I followed Edvin's advice and changed the overlay-debug.conf. After the IMU initialization, neither INT1 nor INT2 triggered, and the IMU shut down.

    CONFIG_LOG=y
    CONFIG_LOG_MODE_DEFERRED=n
    CONFIG_LOG_MODE_IMMEDIATE=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=n
    CONFIG_RTT_CONSOLE=y
    CONFIG_LOG_BACKEND_RTT=y
    CONFIG_LOG_BACKEND_UART=n
    CONFIG_LOG_PRINTK=n
    
    # Troubleshooting
    CONFIG_ASSERT=y
    CONFIG_RESET_ON_FATAL_ERROR=n
    
    
    CONFIG_MAIN_THREAD_PRIORITY=8

    I then applied the following configuration, which allows INT1 to trigger on time even when RTT is disconnected. However, INT2 does not trigger and remains inactive.

    CONFIG_LOG=y
    CONFIG_LOG_MODE_DEFERRED=n
    CONFIG_LOG_MODE_IMMEDIATE=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=n
    CONFIG_RTT_CONSOLE=n
    CONFIG_LOG_BACKEND_RTT=n
    CONFIG_LOG_BACKEND_UART=n
    CONFIG_LOG_PRINTK=n
    
    # Troubleshooting
    CONFIG_ASSERT=y
    CONFIG_RESET_ON_FATAL_ERROR=n
    
    
    CONFIG_MAIN_THREAD_PRIORITY=8

    I don't believe the issue lies with the IMU itself, as the only changes I made were to the overlay-debug.conf.

    You canjust download the latest file that I uploaded here and build. Please note that the SDK version is v2.5.2.

    Thank you,

Children
  • Are there any special things with the INT2?

    I see that there are 3 modes in which  sensor could be connected,

    and the role of INT1 is same for all the modes, but INT2 is different.

    I have not used this sensor, but just pointing if that is something to look at.

  • The problem doesn't seem to be with the sensor configuration since I haven't changed anything on the sensor side and get the proper result while the RTT is connected. However, changing the overlay_debug alters the sensor's behavior. I believe there might be an issue with my nRF configuration. What are your thoughts?

    Thsnk you,

  • But this:

    SaeedZadeh said:
    INT1 should trigger approximately every 10 ms, which it does when the RTT is connected. However, when I disconnect RTT, the trigger time significantly increases to around 170 ms.

    does not make sense then, because the RTT is on the DK / MCU side, and the INT1 is generated by sensor which is already configured, right? How changing (logging) behavior can impact the sensor firing interrupt? I do not know about this sensor configurations. 

    Can you print system time when interrupt is generated by the sensor, and then from there we see how much time it is taking between interrupts, so we do not see the logging time but rather interrupt firing time.

    Can you show the changes you made in the overlay?

Related