Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
PritamSSahoo01 opened this issue Oct 6, 2023 · 0 comments

Comments

@PritamSSahoo01
Copy link

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:

  • device/{vendor}/{product}/BoardConfig.mk (modification)
    - device/{vendor}/{product}/init.{board}.rc (modification)
    - device/{vendor}/{product}/sepolicy/file.te (modification)
    - device/{vendor}/{product}/sepolicy/file_contexts (modification)
    - device/{vendor}/{product}/sepolicy/STSensors.te (add)
    After that i tried to build my AOSP then i got some errors related to the sepolicy.The error logs are:

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant