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.

  • By enabling deferred mode ON by having these configs: 

    CONFIG_LOG_MODE_DEFERRED=y
    CONFIG_LOG_MODE_IMMEDIATE=n

    it turns out that with and without rtt console the timing is same and is ~20ms.

    But as you have mentioned that in this case INT2 does not get fired.

    I have no idea why that could happen. I do not see any conflict in the pins used for interrupt.

    what is use of Signal and Signal_pin?

    I see this in the overlay:

    / {
    	zephyr,user {
    		SIgnal_Pin-gpios = <&gpio1 7 0>;
    	};
    };
    
    / {
    	zephyr,user {
    		SIgnal_Pin-gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
    	};
    };
    

    it this intentional? (what these pins are used for)?

  • Thank you for your response. I'm so confused as to why INT2 isn't triggered in this configuration. It seems that all settings are identical except for some overlay configurations that might be causing the issue.

    Where have you set the timing parameters that captures samples after fix amount of time? Is it fixed in terms of clock cycles or in terms of time units?

    It's not defined; in fact,  once FIFO is full, IMU will interrupt (INT1).

    what is use of Signal and Signal_pin?

    I used the signal pin for debugging to see if it could toggle on time.

    Best,

  • I am writing whatever related is coming to my mind, so please discard if it is not relevant:

    1) What are differences between int1 and int2. 

    2) How / when these are generated? Are these generated by sensor through some configurations, or automatically?

    3) When would int1 be generated? (approx 20ms? ) and what about int2? 

    4) Could there be conflicts between int1 and int2 timings? Could these both be fired at the same time?

    I see they both are configured in the same was in the overlay, just their pins are different.

    I have also gone through the main.c to see how they are configured, and I see these both are being dealt with in the same way. I do not understand why you are disabling these interrupts in the main() after initializations. This could be just as per your needs though.

    Is this something reproducible in the simulation mode? 

Related