I am porting mpu6500 sensor and want to compile IIO sensor HAL, but I cannot compile it successfully. I refer to this patch:
Porting MPU6050 on Android to realize auto rotation of screen - NXP Community
And I get build errors:
List 'out/target/product/evk_8mp/product/etc/vintf/': NAME_NOT_FOUND
The following HALs in device manifest are not declared in FCM <= level 8:
android.hardware.sensors@2.1::ISensors/default
android.hardware.sensors@2.1::ISensors/multihal
android.hardware.sensors@2.1::ISensors/multihal/
ERROR: files are incompatible: android.hardware.sensors@2.1::ISensors/default is deprecated in compatibility matrix at FCM Version 8; it should not be served.
android.hardware.sensors@2.1::ISensors/default is deprecated in compatibility matrix at FCM Version 8; it should not be served.
android.hardware.sensors@2.1::ISensors/default is deprecated in compatibility matrix at FCM Version 8; it should not be served.
android.hardware.sensors@2.1::ISensors/default is deprecated in compatibility matrix at FCM Version 8; it should not be served.
The following instances are in the device manifest but not specified in framework compatibility matrix:
android.hardware.sensors@2.1::ISensors/default
android.hardware.sensors@2.1::ISensors/multihal
android.hardware.sensors@2.1::ISensors/multihal/
Suggested fix:
1. Update deprecated HALs to the latest version.
2. Check for any typos in device manifest or framework compatibility matrices with FCM version >= 8.
3. For new platform HALs, add them to any framework compatibility matrix with FCM version >= 8 where applicable.
4. For device-specific HALs, add to DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE or DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE.: Success
INCOMPATIBLE
Hi
android.hardware.sensors@2.1 is not compatibile with Android14, you need to use higher version.
Or you can add interfaces in android_build/device/nxp/imx8m/evk_8mp/compatibility_matrix.xml and device_framework_matrix.xml
Best Regards
Zhiming
Hi:
android.hardware.sensors@2.1 should be the highest version? What specific changes do I need to make to compile successfully?
Hi @meeeeeei
You can try to add sensors interface in manifest.xml and device_framework_matrix.xml
android_build/device/nxp/imx8m/evk_8mp/manifest.xml
....
<hal format="hidl">
<name>android.hardware.sensros</name>
<transport>hwbinder</transport>
<version>2.1</version>
<interface>
<name>ISensors</name>
<instance>default</instance>
</interface>
</hal>
....
device_framework_matrix.xml
...
<hal format="aidl" optional="true">
<name>nxp.hardware.sensors</name>
<version>2.1</version>
<interface>
<name>ISensors</name>
<instance>default</instance>
</interface>
</hal>
...
evk_8mp.mk
....
PRODUCT_PACKAGES += \
android.hardware.sensors-service.multihal \
android.hardware.sensors@2.1-nxp-IIO-Subhal
...
Best Regards
Zhiming
Hi:
Hi
You can try version 2 in compatibility matrix
Best Regards
Zhiming
Hi:
Is the version of the hal device added before changed to 2.0? I still get an error with this change.
Hi :
After I modified according to the above suggestions, the following errors still occur:
warn: ignoring density 'xxhdpi-v4' for -c option.
[ 13% 2828/20528] build out/target/product/evk_8mp/gen/ETC/framework_compatibility_matrix.device.xml_intermediates/compatibility_matrix.device.xml
FAILED: out/target/product/evk_8mp/gen/ETC/framework_compatibility_matrix.device.xml_intermediates/compatibility_matrix.device.xml
/bin/bash -c "POLICYVERS=\"30\" PLATFORM_SEPOLICY_VERSION=\"34.0\" PLATFORM_SEPOLICY_COMPAT_VERSIONS=\"29.0 30.0 31.0 32.0 33.0 \" FRAMEWORK_VBMETA_VERSION=\"\$(\"out/host/linux-x 86/bin/avbtool\" add_hashtree_footer --print_required_libavb_version --hash_algorithm sha256 --prop com.android.build.system.os_version:14 --prop com.android.build.system.fingerp rint:\$(cat out/target/product/evk_8mp/build_fingerprint.txt) --prop com.android.build.system.security_patch:2023-12-05)\" out/host/linux-x86/bin/asse mble_vintf -i device/nxp/imx8m/evk_8mp/device_framework_matrix.xml -o out/target/product/evk_8mp/gen/ETC/framework_compatibility_matrix.device.xml_int ermediates/compatibility_matrix.device.xml -c \"out/target/product/evk_8mp/gen/ETC/framework_compatibility_matrix.device.xml_intermediates/manifest.check.xml\""
Input file has unknown format.
Error when attempting to convert to manifest:
Error when attempting to convert to compatibility matrix: Could not parse element with name <hal> in element <compatibility-matrix>: Could not parse element with name <version> in element <hal>: Could not parse text "2.1" in element <version>
Hi @Zhiming_Liu
After I modified according to the above suggestions, the following errors still occur:
-Werror -fexceptions -D'OVXLIB_API=__attribute__((visibility("default")))' -Wno-unused-parameter -Wno-implicit-fallthrough -frtti -DANDROID_SDK_VERSION=34 -DGIT_STRING='7f210fe81f8-dirty'
[ 84% 223/264] build out/target/product/evk_8mp/gen/ETC/framework_compatibility_matrix.device.xml_intermediates/compatibility_matrix.device.xml
FAILED: out/target/product/evk_8mp/gen/ETC/framework_compatibility_matrix.device.xml_intermediates/compatibility_matrix.device.xml
/bin/bash -c "POLICYVERS=\"30\" PLATFORM_SEPOLICY_VERSION=\"34.0\" PLATFORM_SEPOLICY_COMPAT_VERSIONS=\"29.0 30.0 31.0 32.0 33.0 \" FRAMEWORK_VBMETA_VERSION=\"\$(\"out/host/linux-x86/bin/avbtool\" add_hashtree_footer --print_required_libavb_version --hash_algorithm sha256 --prop com.android.build.system.os_version:14 --prop com.android.build.system.fingerprint:\$(cat out/target/product/evk_8mp/build_fingerprint.txt) --prop com.android.build.system.security_patch:2023-12-05)\" out/host/linux-x86/bin/assemble_vintf -i device/nxp/imx8m/evk_8mp/device_framework_matrix.xml -o out/target/product/evk_8mp/gen/ETC/framework_compatibility_matrix.device.xml_intermediates/compatibility_matrix.device.xml -c \"out/target/product/evk_8mp/gen/ETC/framework_compatibility_matrix.device.xml_intermediates/manifest.check.xml\""
Input file has unknown format.
Error when attempting to convert to manifest:
Error when attempting to convert to compatibility matrix: Could not parse element with name <hal> in element <compatibility-matrix>: Could not parse element with name <version> in element <hal>: Could not parse text "2.1" in element <version>
[ 85% 225/264] build out/target/product/evk_8mp/obj/PACKAGING/check_vintf_all_intermediates/check_vintf_vendor.log
FAILED: out/target/product/evk_8mp/obj/PACKAGING/check_vintf_all_intermediates/check_vintf_vendor.log
/bin/bash -c "( out/host/linux-x86/bin/checkvintf --check-one --dirmap /vendor:out/target/product/evk_8mp/vendor --dirmap /apex:out/target/product/evk_8mp/apex --property ro.boot.product.vendor.sku= > out/target/product/evk_8mp/obj/PACKAGING/check_vintf_all_intermediates/check_vintf_vendor.log 2>&1 ) || ( cat out/target/product/evk_8mp/obj/PACKAGING/check_vintf_all_intermediates/check_vintf_vendor.log && exit 1 )"
Checking vendor manifest.
getDeviceHalManifest: Reading VINTF information.
Sysprop ro.boot.product.vendor.sku=
Fetch 'out/target/product/evk_8mp/vendor/etc/vintf/manifest.xml': OK
List 'out/target/product/evk_8mp/vendor/etc/vintf/manifest/': OK
Fetch 'out/target/product/evk_8mp/vendor/etc/vintf/manifest/bluetooth_audio.xml': OK
Fetch 'out/target/product/evk_8mp/vendor/etc/vintf/manifest/android.hardware.wifi.hostapd.xml': OK
Fetch 'out/target/product/evk_8mp/vendor/etc/vintf/manifest/thermal-imx.xml': OK
Fetch 'out/target/product/evk_8mp/vendor/etc/vintf/manifest/android.hardware.boot-service.default.xml': OK
Fetch 'out/target/product/evk_8mp/vendor/etc/vintf/manifest/android.hardware.neuralnetworks-shell-service-imx.xml': OK
Fetch 'out/target/product/evk_8mp/vendor/etc/vintf/manifest/android.hardware.usb-service.imx.xml': OK
Fetch 'out/target/product/evk_8mp/vendor/etc/vintf/manifest/android.hardware.wifi.supplicant.xml': OK
Fetch 'out/target/product/evk_8mp/vendor/etc/vintf/manifest/imx_dek_extractor.imx.xml': OK
Fetch 'out/target/product/evk_8mp/vendor/etc/vintf/manifest/sensors-default.xml': OK
Fetch 'out/target/product/evk_8mp/vendor/etc/vintf/manifest/android.hardware.oemlock-service.imx.xml': OK
Fetch 'out/target/product/evk_8mp/vendor/etc/vintf/manifest/memtrack.imx.xml': OK
Fetch 'out/target/product/evk_8mp/vendor/etc/vintf/manifest/allocator.imx.xml': OK
Fetch 'out/target/product/evk_8mp/vendor/etc/vintf/manifest/android.hardware.wifi-service.xml': OK
Fetch 'out/target/product/evk_8mp/vendor/etc/vintf/manifest/android.hardware.health-service.example.xml': OK
Fetch 'out/target/product/evk_8mp/vendor/etc/vintf/manifest/hwc3.xml': OK
Fetch 'out/target/product/evk_8mp/vendor/etc/vintf/manifest/android.hardware.confirmationui-service.trusty.xml': OK
Fetch 'out/target/product/evk_8mp/vendor/etc/vintf/manifest/android.hardware.tv.hdmi.cec-service.imx.xml': OK
Fetch 'out/target/product/evk_8mp/vendor/etc/vintf/manifest/android.hardware.usb.gadget-service.imx.xml': OK
Fetch 'out/target/product/evk_8mp/vendor/etc/vintf/manifest/android.hardware.tv.hdmi.connection-service.imx.xml': OK
Fetch 'out/target/product/evk_8mp/vendor/etc/vintf/manifest/rebootescrow-default.xml': OK
Fetch 'out/target/product/evk_8mp/vendor/etc/vintf/manifest/android.hardware.sensors-multihal.xml': OK
getDeviceHalManifest: status from fetching VINTF information: -2147483648
getDeviceHalManifest: -2147483648 VINTF parse error: Cannot add manifest fragment /vendor/etc/vintf/manifest/android.hardware.sensors-multihal.xml: HAL "android.hardware.sensors" has a conflict: Conflicting FqInstance: ISensors/default (@2) (from /vendor/etc/vintf/manifest/sensors-default.xml) vs. ISensors/default (@2) (from /vendor/etc/vintf/manifest/android.hardware.sensors-multihal.xml). Check whether or not multiple modules providing the same HAL are installed.
ERROR: Cannot fetch vendor manifest.
[ 85% 226/264] depmod out/target/product/evk_8mp/obj/PACKAGING/depmod_VENDOR_RAMDISK_intermediates
depmod: WARNING: could not open modules.order at /home/wuxd/Andorid/IMX8MP/qiyang-imx8m-plus-android14-sdk/out/target/product/evk_8mp/obj/PACKAGING/depmod_VENDOR_RAMDISK_intermediates/lib/modules/0.0: No such file or directory
depmod: WARNING: could not open modules.builtin at /home/wuxd/Andorid/IMX8MP/qiyang-imx8m-plus-android14-sdk/out/target/product/evk_8mp/obj/PACKAGING/depmod_VENDOR_RAMDISK_intermediates/lib/modules/0.0: No such file or directory
depmod: WARNING: could not open modules.builtin.modinfo at /home/wuxd/Andorid/IMX8MP/qiyang-imx8m-plus-android14-sdk/out/target/product/evk_8mp/obj/PACKAGING/depmod_VENDOR_RAMDISK_intermediates/lib/modules/0.0: No such file or directory
[ 85% 227/264] depmod out/target/product/evk_8mp/obj/PACKAGING/depmod_VENDOR_intermediates