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
  • 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,

  • Hello,

    SaeedZadeh said:
    There is no signal on this pin in any configuration.

    Did you connect to the device with a BLE central? It will not start toggling until ble_send() is called.

    I struggle to understand your snippets from the logic analyzer. I am sorry. What is the D2 line in your plot? If it isn't already, can you please try to toggle a pin every time you call ble_send()?

    BR,
    Edvin

  • Yes, I connected to the BLE central. 

    D2 is the interrupt pin of the IMU, which is connected to the nrf53dk.

  • What direction does that pin go? Is it an input or output for the nRF53?

    Edvin said:
    If it isn't already, can you please try to toggle a pin every time you call ble_send()?
Related