STMicroelectronics / STMems_Android_Sensor_HAL_IIO

DISCONTINUED (October 2022): the maintenance for this repository has been discontinued. Please refer to https://github.com/STMicroelectronics/st-mems-android-linux-sensors-hal for the up-to-date HAL repository. This repository contains ST Android sensor Hardware Abstraction Layer (HAL) for MEMS Linux IIO drivers
Apache License 2.0
35 stars 21 forks source link

I2C realted application are not able to read the data using the st_lsm6dsx driver #14

Open PritamSSahoo01 opened 1 year ago

PritamSSahoo01 commented 1 year ago

Hello,

i am using st_lsm6dsx driver for accelometer and gyroscope sensor integration in the kernel level and and i have loaded the driver successfully and getting the values in the kernel level . Below i am mentioning some value logs so that to confirm that the values are coming .

-->phyboard_polis:/ # cat sys/class/i2c-dev/i2c-2/device/2-006b/iio\:device1/name

lsm6dsm_accel

->phyboard_polis:/ # cat sys/class/i2c-dev/i2c-2/device/2-006b/iio\:device1/in_accel_x_raw

10090

So i need to get these values through the apk . So i need to configure the sensor hal . Then i have followed the as mentioned in the Sensor Hal IIO provided by STMicroelectronics/ but i faced many issues in the hal integration.

Initially i don't find any sensor hal of STMicroelectronics/ so i need to create one custom directory for STMicroelectronics/ and copied all the sensor hal codes to that folder by git clone https://github.com/STMicroelectronics/STMems_Android_Sensor_HAL_IIO.git in my android source code in path :hardware/STMicroelectronics/SensorHAL_IIO/STMems_Android_Sensor_HAL_IIO.

Then i followed the steps as mentioned in the Documentation of the hal folder .

First i tried for the Selftest tool manual as mentioned in the Documentation but got too many errors while compiling the AOSP.

Then i tried for the Factory calibration option: So i need to modify the files mentioned in the Documentation as follows:

cho \"List of invalid domains:\" 1>&2; cat out/target/product/phyboard_polis/obj/ETC/sepolicy.recovery_intermediates/sepolicy.permissivedomains 1>&2; exit 1; fi ) && (mv out/target/product/phyboard_polis/obj/ETC/sepolicy.recovery_intermediates/sepolicy.tmp out/target/product/phyboard_polis/obj/ETC/sepolicy.recovery_intermediates/sepolicy )" device/nxp/imx8m/sepolicy/STSensors.te:8:ERROR 'unknown type persist_file' at token ';' on line 62204:

Access to /persist/STSensors

allow STSensors persist_file:dir { open getattr read search ioctl lock watch watch_reads }; checkpolicy: error(s) encountered while parsing configuration 16:43:16 ninja failed with: exit status 1

i have also modified the uevent.{board}.rc as mentioned in the Documentation and an example also there.

Can anyone please help me for the proper integration of the LSM6DSM sensor in the imx8mm board.Note that i am using Andriod R version i.e. Android 11 and my kernel version is 5.4.

Hope for any solution regarding the issue.