cancel
Showing results for 
Search instead for 
Did you mean: 

LSM6DSV16X + IIS2MDC Sensor Integration on Android 10 (i.MX8MM)

yogeshmanjashetty
Associate II

 

We are currently working on integrating the LSM6DSV16X (IMU) and IIS2MDC (Magnetometer) sensors into our platform based on NXP’s i.MX8MM SoC running Android 10. As Android 10 uses the legacy HAL, we’ve followed the integration steps as per the README documentation.

Below are the key configurations and issues we are encountering:


Platform & Sensor Info

  • Android Version: 10 (AOSP)

  • SoC: NXP i.MX8MM

  • Sensor Drivers: LSM6DSV16X and IIS2MDC

  • HAL Version: 1.0 (Legacy)


What We've Done

  1. Integrated device nodes into DTS as follows:

 

dts
CopyEdit
iistmdc_magn@1e
{
compatible = "st,iis2mdc_magn";
reg = <0x1e>;
pictrl-names = "default";
pinctrl-0 = <&pinctrl_st_magno>;
interrupt-parent = <&gpio1>;
interrupts = <14 IRQ_TYPE_EDGE_FALLING>;
st,module_id = <1>;
status = "okay"; };
lsm6dsvx-imu@6b {
compatible = "st,lsm6dsv16x";
reg = <0x6b>;
pictrl-names = "default";
pinctrl-0 = <&pinctrl_st_acc_gyro_yo>;
interrupt-parent = <&gpio1>;
interrupts = <15 IRQ_TYPE_EDGE_FALLING>;
st,int-pin = <2>;
mount-matrix = "1", "0", "0",
               "0", "1", "0",
               "0", "0", "1";
st,module_id = <1>;
status = "okay";
};
 
  1. Enabled relevant sensor configurations in the kernel defconfig.

  2. Disabled the time sync library at both HAL and kernel levels, as per recommendations.


Observed Behaviour

  • Sensor HAL is loading and initialising properly.

  • On launching the test application, the HAL shows the correct sensor activation and reports a polling rate (e.g., 15 Hz).

  • However, no sensor values are reported back to the app.

  • /proc/interrupts confirms that the IRQ count does not increment over time.

  • From the logs:

    • FIFO length is reported as 0, leading to no data being read.

  • If interrupts are disabled, we can successfully read data from sysfs, which confirms basic I2C communication is working.


Request

We are currently stuck as to what the next step should be:

  • Should we focus on debugging interrupt handling from the kernel driver side?

  • Is there a specific step required in the HAL or DTS that could enable proper FIFO/IRQ flow?

We would appreciate any insight or suggestions. For reference, I can provide the complete DTS and defconfig snippets if required.

Thanks in advance for your support.

2 REPLIES 2
Andrew Neil
Super User

@yogeshmanjashetty wrote:
  • If interrupts are disabled, we can successfully read data from sysfs, which confirms basic I2C communication is working.


So it sounds like this is an Android problem - nothing to do with the sensor itself?

Therefore you really need to go to an Android developer forum for help with that ...

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

Hi @Andrew Neil,

Thanks for your response.

Just to clarify — we’re indeed using Android 10 on the NXP i.MX8MM SoC. With this setup, we previously integrated the ICM20948 sensor using the legacy HAL (1.0) interface, and it worked successfully.

However, now we are integrating STMicroelectronics’ LSM6DSV16X (IMU) and IISTMDC (Magnetometer) sensors and encountering an issue where:

  • The sensors initialize correctly.

  • The application receives the correct poll rate (15Hz), and HAL logs show sensor state is ON.

  • But the sensor values reported to the framework are always zero.

  • cat /proc/interrupts shows no increment in IRQ counters, suggesting no data-ready interrupts.

  • The FIFO length read in the driver is zero, despite enabling polling and batching in HAL.

  • Interestingly, when we disable the interrupt configuration, we can read values through sysfs manually.

We’ve made all DTS and defconfig changes as documented in the STM driver README and disabled the Time Sync library at both HAL and kernel levels as advised.

Our question is:

  • Are there any additional kernel/Android HAL configurations needed specifically for LSM6DSV16X and IISTMDC to work in legacy HAL mode on Android 10?