2023-10-06 04:27 AM
Android R can't get LSM6DSM HAL Accelerometer/Gyroscope data on iMX8MM board.
following the steps as mentioned :
1.copied the hal source code into hardware/STMicroelectronics/SensorHAL_IIO.
2.Looking to the Documentation folder i have made the changes accordingly.First i have tried using the Selftest tool manual but lots of error get generated during the compilation and i don't see any binary as STSensor_selftest in the provided path as:/system/bin/STSensor_selftest.
3.Then i tried for the Factory calibration option and modified the source code as mentioned
Those modifications will touch:
- 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)
but during compilation of AOSP i am getting the error regarding the sepoilcy changes as:
[ 1% 24/1701] build out/target/product/phyboard_polis/obj/FAKE/sepolicy_neverallows_intermediates/sepolicy_neverallows
FAILED: out/target/product/phyboard_polis/obj/FAKE/sepolicy_neverallows_intermediates/sepolicy_neverallows
/bin/bash -c "(ASAN_OPTIONS=detect_leaks=0 out/host/linux-x86/bin/checkpolicy -M -c 30 -o out/target/product/phyboard_polis/obj/FAKE/sepolicy_neverallows_intermediates/sepolicy_neverallows.tm
p out/target/product/phyboard_polis/obj/FAKE/sepolicy_neverallows_intermediates/policy.conf ) && (out/host/linux-x86/bin/sepolicy-analyze out/target/product/phyboard_polis/obj/FAKE/sepolicy_neverallows_i
ntermediates/sepolicy_neverallows.tmp neverallow -w -f out/target/product/phyboard_polis/obj/FAKE/sepolicy_neverallows_intermediates/policy_2.conf || ( echo \"\" 1>&2; echo \"sepolicy-analyze
failed. This is most likely due to the use\" 1>&2; echo \"of an expanded attribute in a neverallow assertion. Please fix\" 1>&2; echo \"the policy.\" 1>&2; exit 1 ) ) && (touch ou
t/target/product/phyboard_polis/obj/FAKE/sepolicy_neverallows_intermediates/sepolicy_neverallows.tmp ) && (mv out/target/product/phyboard_polis/obj/FAKE/sepolicy_neverallows_intermediates/sepolicy_nevera
llows.tmp out/target/product/phyboard_polis/obj/FAKE/sepolicy_neverallows_intermediates/sepolicy_neverallows )"
device/nxp/imx8m/sepolicy/STSensors.te:8:ERROR 'unknown type persist_file' at token ';' on line 58506:
# 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
[ 1% 25/1701] build out/target/product/phyboard_polis/obj/ETC/sepolicy.recovery_intermediates/sepolicy
FAILED: out/target/product/phyboard_polis/obj/ETC/sepolicy.recovery_intermediates/sepolicy
/bin/bash -c "(ASAN_OPTIONS=detect_leaks=0 out/host/linux-x86/bin/checkpolicy -M -c 30 -o out/target/product/phyboard_polis/obj/ETC/sepolicy.recovery_intermediates/sepolicy.tmp out/target/pro
duct/phyboard_polis/obj/ETC/sepolicy.recovery_intermediates/sepolicy.recovery.conf ) && (out/host/linux-x86/bin/sepolicy-analyze out/target/product/phyboard_polis/obj/ETC/sepolicy.recovery_intermediates/
sepolicy.tmp permissive > out/target/product/phyboard_polis/obj/ETC/sepolicy.recovery_intermediates/sepolicy.permissivedomains ) && (if [ \"userdebug\" = \"user\" -a -s out/target/product/phyboard_polis/
obj/ETC/sepolicy.recovery_intermediates/sepolicy.permissivedomains ]; then echo \"==========\" 1>&2; echo \"ERROR: permissive domains not allowed in user builds\" 1>&2; e
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
#### failed to build some targets (28 seconds) ####
is there any specific way to deal with this error ???
Please provide me a proper guide or reference to integrate the LSM6DSM sensor to the android 11 to imx8mm board.
Thanks in advance.