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 Reply Children
  • Sure, I recorded the signal while the RTT log was enabled, and after some moments, I disabled it.

    This is the whole signal; please notice the red line shows the FIFO interrupt events:

      

    This picture shows the beginning and end of one burst of sensor output while RTT is enabled; It doesn't show the middle signals as they are just the IMU data values:

    And this picture belongs to the signals when the RTT log was disabled:

    As you can see, everything is the same, but the output signal rate.

    the 1B register is FIFO_STATUS1 register



  • Hello,

    So this is a I2C device. I assume the nRF is the I2C Master, right? Unless the sensor is the I2C master, then all the read events must be triggered by the nRF, and this means that you must use some event to trigger the next transmission. 

    Is it possible to share some snippets/files showing how you set up and communicate with the sensor?

  • Hello,

    So I ran your application. Thanks for including the IMU_SIMULATION definition. It makes these things a lot simpler.

    Just to clarify, you see the same behavior when setting IMU_SIMULATION to 1 as well?

    When you say "disable logging", you mean setting these two in your prj.conf?

    CONFIG_SERIAL=n
    CONFIG_LOG=n

    If so, I see nowhere near 1 second. 

    I do, however, see this when I enable notifications on my central:

    So it is slower, but it is also actually sending notifications, so I expect there to be some delays. 

    nrf5340_imu_adc_led_ble.zip

    Can you please test the attached project, and measure pin P0.05 using the logic analyzer? What does it look like? (if you don't use the actual sensor, but the simulated sensor). Or does the issue only occur when you set IMU_SIMULATION to 0?

    Best regards,

    Edvin

  • Thank you for your reply.

    you see the same behavior when setting IMU_SIMULATION to 1 as well?

    yes

    When you say "disable logging", you mean setting these two in your prj.conf?

    I meant, when I connect to RTT. When it connects, I receive a proper signal; once I disconnect it, the frequency of interrupts significantly drops. Here:

    Now, during testing, I just realized that the same behaviour is present even in simulation mode.

    Can you please test the attached project, and measure pin P0.05 using the logic analyzer?

    There is no signal on this pin in any configuration.

    r does the issue only occur when you set IMU_SIMULATION to 0?

    As I mentioned above, yes, it occurred in both modes. I can see the data rate changes on another device connected to this device through BLE.

    Best,

Related