Skip to main content
Visitor II
May 9, 2025
Solved

Is There a Dedicated Android Library for Interfacing with STHS34PF80 Proximity Sensor?

  • May 9, 2025
  • 2 replies
  • 579 views

Hi,
I am currently working on a project using the STHS34PF80 proximity sensor from STMicroelectronics. The platform is running Android 14.0.0_1.0.0 (L6.1.55_2.2.0 BSP).

I would like to know if there is a dedicated Android driver or SDK available to directly interface with the STHS34PF80 sensor—either from STMicroelectronics or open-source contributors.

I have the datasheet and application notes for the sensor, and I understand its I²C communication protocol. However, before starting from scratch, I’d like to ask:

1) Any existing Android libraries or HAL implementations

2) Sensor integration examples in Android (preferably for NXP i.MX8M Plus - based platforms)


Any examples or references would be greatly appreciated.


Thanks in advance for your support!

    This topic has been closed for replies.
    Best answer by ahsrabrifat

    STMicroelectronics provides an official Linux Industrial I/O (IIO) driver for the STHS34PF80 sensor, which is compatible with Android platforms. This driver is part of the st-mems-android-linux-drivers-iio repository and includes support for both I²C and SPI interfaces. https://github.com/STMicroelectronics/st-mems-android-linux-drivers-iio/blob/master/drivers/iio/stm/tmos/st_sths34pf80/Kconfig

    For Android integration, ST offers the Android/Linux Sensor Hardware Abstraction Layer (HAL), which works with the IIO subsystem. This HAL provides a standardized interface for ST sensors, facilitating easier integration into Android systems. 

    https://www.st.com/en/embedded-software/androidlinuxhal.html

    2 replies

    Visitor II
    May 9, 2025

    STMicroelectronics provides an official Linux Industrial I/O (IIO) driver for the STHS34PF80 sensor, which is compatible with Android platforms. This driver is part of the st-mems-android-linux-drivers-iio repository and includes support for both I²C and SPI interfaces. https://github.com/STMicroelectronics/st-mems-android-linux-drivers-iio/blob/master/drivers/iio/stm/tmos/st_sths34pf80/Kconfig

    For Android integration, ST offers the Android/Linux Sensor Hardware Abstraction Layer (HAL), which works with the IIO subsystem. This HAL provides a standardized interface for ST sensors, facilitating easier integration into Android systems. 

    https://www.st.com/en/embedded-software/androidlinuxhal.html

    Visitor II
    July 8, 2025

    Hi, We have tried to integrate the sensor and it went well. While trying to read the proximity values from the sensor using linux on nxp imx8mp, we are getting value as 0. Also, no activities on trigger is seen. I have attached the files we used. Can anyone help on this ?

    Explorer
    July 16, 2025

    Hi,
    I am integrating the STHS34PF80 proximity MEMS sensor using the STMicroelectronics HAL from the following repository:

    https://github.com/STMicroelectronics/st-mems-android-linux-sensors-hal/tree/master

    However, when I run the HAL binary, I encounter the following error:

    "root@imx8mp-lpddr4-evk:/st-mems-android-linux-sensors-hal/linux/build# ./stm-sensors-linux
    failed to open config file [/etc/stm-sensors-hal/config], using defaults
    found 5 IIO devices available under /sys/bus/iio/devices
    sths34pf80_tmotion: IIO device not supported by sensorHAL
    sths34pf80_tobject_comp: IIO device not supported by sensorHAL
    sths34pf80_tpresence: IIO device not supported by sensorHAL
    sths34pf80_tambshock: IIO device not supported by sensorHAL
    sths34pf80_tobjamb: IIO device not supported by sensorHAL
    No IIO sensors found!
    no sensors available!"Screenshot 2025-07-16 094141.jpg

    Could you please guide me on how to add support for the sths34pf80 sensor in the ST HAL or help me resolve this issue?

    Thank you.