VAR-DART-IMX8MM-MINI Implementing PN7160 to Android 14

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

VAR-DART-IMX8MM-MINI Implementing PN7160 to Android 14

3,133 Views
hraducu
Contributor I

Hi,

 

I am trying to integrate the PN7160 on my device into Android 14. I followed the porting PN7160 to Android 14 guide (AN14430), I applied all patches and driver. No matter what I try, I cant seem to get it to start working. I went through various failures and am now at a point where I get issues with android.hardware.tv.tuner.ITuner, I am not sure where this comes from.

 

Does anyone have any experiencing implementing this device or any guidance would be appreciated.

 

Thanks.

0 Kudos
Reply
7 Replies

3,124 Views
JosephAtNXP
NXP TechSupport
NXP TechSupport

Hi,

Thank you for your interest in NXP Semiconductor products,

Could you try to follow this post in a fresh build?

Regards

0 Kudos
Reply

3,096 Views
hraducu
Contributor I

Hi Joseph,

I have followed the guide again after reverting. The first error I see when building is this

FAILED:
build/make/core/Makefile:73: error: overriding commands for target `out/target/product/dart_mx8mm/system/etc/permissions/com.nxp.nfc.xml', previously defined at out/soong/installs-dart_mx8mm.mk:101314
12:10:00 ckati failed with: exit status 1

and

FAILED:
build/make/core/Makefile:73: error: overriding commands for target `out/target/product/dart_mx8mm/system/etc/libnfc-nci.conf', previously defined at out/soong/installs-dart_mx8mm.mk:142606

I can resolve these by removing the lines from device-nfc.mk:

vendor/$(NXP_VENDOR_DIR)/frameworks/nfc/com.nxp.nfc.xml:system/etc/permissions/com.nxp.nfc.xml
 
vendor/$(NXP_VENDOR_DIR)/nfc/hw/$(NXP_NFC_HW)/libnfc-nci.conf:system/etc/libnfc-nci.conf \
 
If I remove these lines, I then get these errors

FAILED: out/target/product/dart_mx8mm/gen/ETC/vendor_compatibility_matrix.xml_intermediates/compatibility_matrix.xml
/bin/bash -c "REQUIRED_VNDK_VERSION=34 BOARD_SYSTEMSDK_VERSIONS=\"34\" out/host/linux-x86/bin/assemble_vintf -i device/nxp/imx8m/evk_8mm/compatibility_matrix.xml -o out/target/product/dart_mx8mm/gen/ETC/vendor_compatibility_matrix.xml_intermediates/compatibility_matrix.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.0" in element <version>
12:28:34 ninja failed with: exit status 1
 
Thanks for your help
0 Kudos
Reply

3,059 Views
hraducu
Contributor I

A quick update,

I was able to build successfully by removing the following 2 lines:

 
vendor/$(NXP_VENDOR_DIR)/frameworks/nfc/com.nxp.nfc.xml:system/etc/permissions/com.nxp.nfc.xml

vendor/$(NXP_VENDOR_DIR)/nfc/hw/$(NXP_NFC_HW)/libnfc-nci.conf:system/etc/libnfc-nci.conf \
 
I also updated the compatibility matrix from aidl to hidl
 
 
<hal format="hidl" optional="true">
        <name>vendor.nxp.nxpnfc</name>
        <transport>hwbinder</transport>
        <version>2.0</version>
        <interface>
            <name>INxpNfc</name>
            <instance>default</instance>
        </interface>
    </hal>
 
 I don't know if these changes are correct so please let me know.
 
After building, I can see my driver is probing and it seems to be loaded correctly and I have the node dev/nxpnfc but I cannot access nfc through android. I do not see the nfc hal running.
 
In vendor/lib64/ I have:
android.hardware.nfc-V1-ndk.so
[email protected]
[email protected]
[email protected]
nfc_nci_nxp_pn72xx.so
[email protected]
 
And in vendor/bin/hw I have:
android.hardware.nfc-service.nxp
 
In my prop I have the following for nfc:
[persist.nfc.enabled]: [1]
[ro.hardware.nfc_nci]: [pn54x]
[ro.nfc.port]: [I2C]
But I am using the PN7160 on SPI...
 
Can you please provide any guidance whether these changes are correct and what further we should do to implement the nfc?
 
Thank you for your help.
0 Kudos
Reply

3,021 Views
JosephAtNXP
NXP TechSupport
NXP TechSupport

Hi @hraducu,

The post author could replicate on the mentioned BSP version in EVK, this will most likely be a DART SW porting issue, do you have an EVK handy so you can confirm it?

Regards

0 Kudos
Reply

3,006 Views
hraducu
Contributor I

Hi @JosephAtNXP,

Thanks, I was actually able to get it working after a bit of tinkering.

I guess in case anyone else attempts to do this, I think the main change turned out to be:

In hardware/nxp/nfc/pn72xx/aidl/nfc-service-nxp.rc:

service vendor.nfc_hal_service /vendor/bin/hw/android.hardware.nfc-service.nxp
    class early_hal
    user nfc
    group nfc system
    interface [email protected]::INfc default
    interface [email protected]::INfc default
    interface [email protected]::INfc default
    interface [email protected]::INxpNfc default
    seclabel u:r:hal_nfc_default:s0
    disabled
    oneshot

 

device/nxp/imx8mm/evk_8mm/device_framework_matrix.xml:

    <hal format="aidl">
        <name>vendor.nxp.nxpnfc</name>
        <interface>
            <name>INxpNfc</name>
            <instance>default</instance>
        </interface>
    </hal>
    <hal format="aidl" optional="true">
        <name>android.hardware.emvco</name>
        <version>1</version>
        <interface>
            <name>IEmvco</name>
            <instance>default</instance>
        </interface>
    </hal>

I think there were some other changes I made based on the errors I was getting but the main would be the nfc-service-nxp.rc change.

Thanks.

 

0 Kudos
Reply

2,135 Views
persandberg
Contributor III

Hi,

I hope you could help me. Did you get this to work? I have followed the Android 15 porting guide and also the guide NXP imx8mn EVK. https://community.nxp.com/t5/NFC-Knowledge-Base/PN7160-PN7220-Android-15-Porting-to-i-MX8MN-EVK/ta-p... The changes you did, have I also applyed. I am using imx8mp and made appropriate changes for that I think. I am struggling with the following error:

[ 25% 37339/145266] //system/libhidl/transport/token/1.0:[email protected] clang++ android/hidl/token/1.0/TokenManagerAll.cpp (priority: 34)
FAILED: out/soong/.intermediates/system/libhidl/transport/token/1.0/[email protected]/android_vendor_arm64_armv8-a_cortex-a53_static/obj/.intermediates/system/libhidl/transport/token/1.0/[email protected]_genc++/gen/android/hidl/token/1.0/TokenManagerAll.o

2,100 Views
persandberg
Contributor III

Ignore my previous question, I got forward when changed the build command.
Now I get stuck later in the build with the following error:

[ 37% 40388/107920] Verify hardware/nxp/nfc/intf/nxpnfc/aidl/aidl_api/vendor.nxp.nxpnfc_aidl/2 files have not been modified
FAILED: out/soong/.intermediates/hardware/nxp/nfc/intf/nxpnfc/aidl/vendor.nxp.nxpnfc_aidl_interface/checkhash_2.timestamp
if [ $(cd 'hardware/nxp/nfc/intf/nxpnfc/aidl/aidl_api/vendor.nxp.nxpnfc_aidl/2' && { find ./ -name "*.aidl" -print0 | LC_ALL=C sort -z | xargs -0 sha1sum && echo 1; } | sha1sum | cut -d " " -f 1) = $(tail -1 'hardware/nxp/nfc/intf/nxpnfc/aidl/aidl_api/vendor.nxp.nxpnfc_aidl/2/.has
h') ]; then touch out/soong/.intermediates/hardware/nxp/nfc/intf/nxpnfc/aidl/vendor.nxp.nxpnfc_aidl_interface/checkhash_2.timestamp; else cat 'system/tools/aidl/build/message_check_integrity.txt' && exit 1; fi
###############################################################################
# ERROR: Modification detected of stable AIDL API file #
###############################################################################
Above AIDL file(s) has changed, resulting in a different hash. Hash values may
be checked at runtime to verify interface stability. If a device is shipped
with this change by ignoring this message, it has a high risk of breaking later
when a module using the interface is updated, e.g., Mainline modules.
13:17:42 ninja failed with: exit status 1

#### failed to build some targets (31:07 (mm:ss)) ####