AN11690
AN11690
Document information
Information Content
Keywords Android, NFC, NXP, NCI, PN7120, PN7150
Abstract This note describes how to add support for an NXP NCI-based NFC
Controller to an Android system.
NXP Semiconductors
AN11690
NXP NCI Android Porting Guidelines
1 Revision history
Revision history
Rev Date Description
2.0 20201214 Added support for Android R (PN7150 only)
Added troubleshooting guidelines about CTS/VTS testing
1.9 20200204 Added support for Android Q (PN7150 only)
1.8 20190710 Fixed confusing errors in Android Oreo guidelines
1.7 20181217 Fixed error in Android Pie installation guidelines (install script path)
Mention added about PN7150 derivative support of Android Pie and Oreo
1.6 20181008 Repositories moved back to GitHub
Added support for Android Pie (PN7150 only)
1.5 20180330 Repositories moved to CodeAurora
Added support for Android Oreo (PN7150 only)
1.4 20170530 Added description of the NFC Factory Test native application
1.3 20170512 Added support for Android Nougat
Added note about porting to other Android versions than referenced ones
Fixed typo about kernel driver repository address
Added information about sepolicy definition in the troubleshooting section
1.2 20160819 Added support for Android Marshmallow
1.1 20160525 Update for PN7150 support
1.0 20150602 First release
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
2 Introduction
This document provides guidelines for the integration of NXP NCI-based NFC Controller
to an Android platform from software perspective.
It first explains how to install the required kernel driver, then it describes step by step
how to adapt the Android Open Source Project sources from the NXP-NCI Android NFC
package delivery. Figure 1 shows the architecture of the Android NFC stack.
• The pn5xx_I2c driver is the kernel module allowing to access NXP NCI-based NFC
Controller hardware resource.
• The NXP NCI HAL module is the implementation of NXP NFC Controller’s specific
Hardware Abstraction Layer.
• The libnfc-nci is the native library providing NFC functionality for which extension is
added to support NXP proprietary features (e.g. support for MIFARE Classic).
• The JNI is a glue code between Java and Native classes. Extension exposes related
additional interface.
• The NFC service is the application framework module providing access to NFC
functionality. Extension is delivered to support NXP proprietary features.
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
3 Kernel driver
The NXP-NCI Android stack uses PN5xx I2C kernel mode driver to communicate with the
NXP NCI NFC Controller. It is available from the following repository: https://github.com/
NXPNFCLinux/nxp-pn5xx.
$ cd drivers/misc
$ git clone https://github.com/NXPNFCLinux/nxp-pn5xx.git
This will create the sub-folder nxp-pn5xx containing the following files:
• pn5xx_i2c.c: driver implementation
• pn5xx_i2c.h: driver interface definition
• README.md: repository comments
• Makefile: driver related makefile
• Kconfig: driver related config file
• LICENSE: driver licensing terms
• sample_devicetree.txt: example of device tree definition
obj-y += nxp-pn5xx/
Include the driver config by adding below line to the heading configuration file (drivers/
misc/Kconfig).
source "drivers/misc/nxp-pn5xx/Kconfig"
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
Below is an example of definition to be added to the platform device tree file (.dts file
located for instance under arch/arm/boot/dts kernel sub-folder for ARM based platform).
&i2c{
status = "okay";
pn547: pn547@28 {
compatible = "nxp,pn547";
reg = <0x28>;
clock-frequency = <400000>;
interrupt-gpios = <&gpio2 17 0>;
enable-gpios = <&gpio4 21 0>;
};
};
Below is an example of definition to be added to the platform definition file. The structure
pn544_i2c_platform_data being defined in the driver interface header file, pn5xx_i2c.h
must be included in the platform definition file, and pn5xx_i2c.h file must be copied to
include/linux kernel source sub-folder.
Then the declared nfc_board_info structure must be added to the platform using
dedicated procedure (platform specific).
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
If <M> option is selected, build the driver and install the generated pn5xx_i2c.ko module.
Otherwise if built-in, rebuild the complete kernel, the driver will be included in the kernel
image.
If the device tree method was used in previous step, build the platform related device tree
and install generated dtb file.
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
4 AOSP adaptation
4.1 Android R
Below step-by-step procedure is based on NXP’s Android NFC delivery from https://
github.com/NXPNFCLinux/nxpnfc_android_r repository.
The current release is based on Android AOSP 11.0.0 version, porting on other R version
may requires minor adaptation of API (detected when compiling).
Pay attention that the AOSP adaptation of Android R is only delivered for PN7150
(and PN7150 derivatives like PN7150X) support.
$ ${ANDROID_BUILD_TOP}/vendor/nxp/nfc/install_NFC.sh
This will:
• Patch the AOSP system/nfc implementation to add PN7150 specific support
• Patch the AOSP hardware/nxp/nfc implementation to add PN7150 specific support
• Patch the AOSP packages/apps/Nfc folder to add support for PN7150 extensions
feature
• Patch the AOSP frameworks/native definitions to add specific permissions
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
-include vendor/nxp/nfc/BoardConfigNfc.mk
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
4.2 Android Q
Below step-by-step procedure is based on NXP’s Android NFC delivery from https://
github.com/NXPNFCLinux/nxpnfc_android_q repository.
The current release is based on Android AOSP 10.0.0 version, porting on other Q version
may requires minor adaptation of API (detected when compiling).
Pay attention that the AOSP adaptation of Android Q is only delivered for PN7150
(and PN7150 derivatives like PN7150X) support.
$ ${ANDROID_BUILD_TOP}/vendor/nxp/nfc/install_NFC.sh
This will:
• Patch the AOSP system/nfc implementation to add PN7150 specific support
• Patch the AOSP hardware/nxp/nfc implementation to add PN7150 specific support
• Patch the AOSP packages/apps/Nfc folder to add support for PN7150 extensions
feature
• Patch the AOSP frameworks/native definitions to add specific permissions
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
-include vendor/nxp/nfc/BoardConfigNfc.mk
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
$ ${ANDROID_BUILD_TOP}/vendor/nxp/nfc/install_NFC.sh
This will:
• Patch the AOSP hardware/nxp/nfc implementation to add PN7150 specific support
• Patch the AOSP packages/apps/Nfc to add support for PN7150 AGC debug feature
-include vendor/nxp/nfc/BoardConfigNfc.mk
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
$ wget https://raw.githubusercontent.com/NXPNFCLinux/nxpnfc_android_oreo/master/
nxpnfc_manifest.xml
$ curl https://raw.githubusercontent.com/NXPNFCLinux/nxpnfc_android_oreo/master/
nxpnfc_manifest.xml > nxpnfc_manifest.xml
Then install it as local manifest in the AOSP source directory (if not existing, simply
create it):
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
$ ./NxpNfcAndroid/install_NFC.sh
PRODUCT_PACKAGES += \
NfcNci \
Tag \
[email protected] \
[email protected] \
nfc_nci.pn54x
PRODUCT_PROPERTY_OVERRIDES += \
ro.hardware.nfc_nci=pn54x
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.nfc.xml:system/etc/permissions/
android.hardware.nfc.xml \
frameworks/native/data/etc/android.hardware.nfc.hce.xml:system/etc/permissions/
android.hardware.nfc.hce.xml \
frameworks/native/data/etc/android.hardware.nfc.hcef.xml:system/etc/permissions/
android.hardware.nfc.hcef.xml \
NxpNfcAndroid/conf/libnfc-brcm.conf:system/vendor/etc/libnfc-brcm.conf \
NxpNfcAndroid/conf/libnfc-nxp.conf:system/vendor/etc/libnfc-nxp.conf \
NxpNfcAndroid/conf/libnfc-nxp_RF.conf:system/vendor/libnfc-nxp_RF.conf
<hal format="hidl">
<name>android.hardware.nfc</name>
<transport>hwbinder</transport>
<impl level="generic"></impl>
<version>1.0</version>
<interface>
<name>INfc</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>vendor.nxp.nxpnfc</name>
<transport>hwbinder</transport>
<impl level="generic"></impl>
<version>1.0</version>
<interface>
<name>INnxpNfc</name>
<instance>default</instance>
</interface>
</hal>
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
$ wget https://raw.githubusercontent.com/NXPNFCLinux/nxpnfc_android_nougat/master/
nxpnfc_manifest.xml
$ curl https://raw.githubusercontent.com/NXPNFCLinux/nxpnfc_android_nougat/master/
nxpnfc_manifest.xml > nxpnfc_manifest.xml
$ ./NxpNfcAndroid/install_NFC.sh <NFCC>
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
# NFC packages
PRODUCT_PACKAGES += \
libnfc-nci \
libnfc_nci_jni \
nfc_nci_pn54x.default\
NfcNci \
Tag \
com.android.nfc_extras
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/com.nxp.mifare.xml:system/etc/permissions/com.nxp.mifare.xml \
frameworks/native/data/etc/com.android.nfc_extras.xml:system/etc/permissions/
com.android.nfc_extras.xml \
frameworks/native/data/etc/android.hardware.nfc.xml:system/etc/permissions/
android.hardware.nfc.xml \
frameworks/native/data/etc/android.hardware.nfc.hce.xml:system/etc/permissions/
android.hardware.nfc.hce.xml \
NxpNfcAndroid/android.hardware.nfc.hcef.xml:system/etc/permissions/
android.hardware.nfc.hcef.xml \
NxpNfcAndroid/conf/libnfc-brcm.conf:system/etc/libnfc-brcm.conf \
NxpNfcAndroid/conf/libnfc-nxp.conf:system/etc/libnfc-nxp.conf
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
# NFC
setprop ro.nfc.port "I2C"
chmod 0660 /dev/pn544
chown nfc nfc /dev/pn544
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
$ wget https://raw.githubusercontent.com/NXPNFCLinux/nxpnfc_android_marshmallow/master/
nxpnfc_manifest.xml
$ curl https://raw.githubusercontent.com/NXPNFCLinux/nxpnfc_android_marshmallow/master/
nxpnfc_manifest.xml > nxpnfc_manifest.xml
$ ./NxpNfcAndroid/install_NFC.sh <NFCC>
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
# NFC packages
PRODUCT_PACKAGES += \
libnfc-nci \
libnfc_nci_jni \
nfc_nci_pn54x.default\
NfcNci \
Tag \
com.android.nfc_extras
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/com.nxp.mifare.xml:system/etc/permissions/com.nxp.mifare.xml \
frameworks/native/data/etc/com.android.nfc_extras.xml:system/etc/permissions/
com.android.nfc_extras.xml \
frameworks/native/data/etc/android.hardware.nfc.xml:system/etc/permissions/
android.hardware.nfc.xml \
frameworks/native/data/etc/android.hardware.nfc.hce.xml:system/etc/permissions/
android.hardware.nfc.hce.xml \
NxpNfcAndroid/android.hardware.nfc.hcef.xml:system/etc/permissions/
android.hardware.nfc.hcef.xml \
NxpNfcAndroid/conf/libnfc-brcm.conf:system/etc/libnfc-brcm.conf \
NxpNfcAndroid/conf/libnfc-nxp.conf:system/etc/libnfc-nxp.conf
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
# NFC
setprop ro.nfc.port "I2C"
chmod 0660 /dev/pn544
chown nfc nfc /dev/pn544
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
$ wget https://raw.githubusercontent.com/NXPNFCLinux/nxpnfc_android_lollipop/master/
nxpnfc_manifest.xml
$ curl https://raw.githubusercontent.com/NXPNFCLinux/nxpnfc_android_lollipop/master/
nxpnfc_manifest.xml > nxpnfc_manifest.xml
$ ./NxpNfcAndroid/install_NFC.sh <NFCC>
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
# NFC packages
PRODUCT_PACKAGES += \
libnfc-nci \
libnfc_nci_jni \
nfc_nci_pn54x.default\
NfcNci \
Tag \
com.android.nfc_extras
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/com.nxp.mifare.xml:system/etc/permissions/com.nxp.mifare.xml \
frameworks/native/data/etc/com.android.nfc_extras.xml:system/etc/permissions/
com.android.nfc_extras.xml \
frameworks/native/data/etc/android.hardware.nfc.xml:system/etc/permissions/
android.hardware.nfc.xml \
frameworks/native/data/etc/android.hardware.nfc.hce.xml:system/etc/permissions/
android.hardware.nfc.hce.xml \
NxpNfcAndroid/conf/libnfc-brcm.conf:system/etc/libnfc-brcm.conf \
NxpNfcAndroid/conf/libnfc-nxp.conf:system/etc/libnfc-nxp.conf
# NFC
setprop ro.nfc.port "I2C"
chmod 0660 /dev/pn544
chown nfc nfc /dev/pn544
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
├── aosp
│ └── external/libnfc-nci
│ └── ...
│ └── frameworks/base
│ └── core/java/android/nfc
│ └── ...
│ └── core/java/com/vzw/nfc
│ └── ...
│ └── Android.mk
│ └── hardware/libhardware/include/hardware
│ └── nfc.h
│ └── packages/apps/Nfc
│ └── ...
├── conf
│ └── libnfc-brcm.conf
│ └── libnfc-nxp.conf
├── FactoyTestApp
│ └── Android.mk
│ └── NfcFactoryTestApp.c
├── doc
│ └── AN11690 – NXP-NCI Android Porting Guidelines.pdf
└── README.txt
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
D_CFLAGS += -DNFC_NXP_CHIP_PN548AD=TRUE
• for PN7120
D_CFLAGS += -DNFC_NXP_CHIP_PN548AD=FALSE
# NFC packages
PRODUCT_PACKAGES += \
libnfc-nci \
libnfc_nci_jni \
nfc_nci_pn54x.default\
NfcNci \
Tag \
com.android.nfc_extras
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/com.nxp.mifare.xml:system/etc/permissions/com.nxp.mifare.xml \
frameworks/native/data/etc/com.android.nfc_extras.xml:system/etc/permissions/
com.android.nfc_extras.xml \
frameworks/native/data/etc/android.hardware.nfc.xml:system/etc/permissions/
android.hardware.nfc.xml \
frameworks/native/data/etc/android.hardware.nfc.hce.xml:system/etc/permissions/
android.hardware.nfc.hce.xml
# NFC
setprop ro.nfc.port "I2C"
chmod 0660 /dev/pn544
chown nfc nfc /dev/pn544
Examples are given in the NXP-NCI Android NFC package, under conf sub-directory, but
pay attention that some adaptation may be required according to your integration (see
chapter “Section 5” for more details). Then reboot the platform.
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
5 Configuration files
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
Below is the description of the different useful tags in the configuration files (refer to the
conf files for detailed information about the tag values).
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
$ mmm vendor/nxp/nfc/FactoryTestApp
$ mmm NxpNfcAndroid/FactoryTestApp
On the Android target, update the file rights to allow execution and, after making sure the
NFC service is disabled (in “Settings” app NFC must be off), run the application:
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
7 Troubleshooting
The following items may help figuring out what is going wrong in case NFC is not working
as expected when starting the Android device.
…
D/NxpTml ( 894): Opening port=/dev/pn544
E/NxpTml ( 894): _i2c_open() Failed: retval ffffffff
D/NxpTml ( 894): phTmlNfc_i2c_reset(), VEN level 0
E/NxpHal ( 894): phTmlNfc_Init Failed
D/NfcAdaptation( 894): NfcAdaptation::HalDeviceContextCallback: event=0
I/BrcmNfcNfa( 894): nfc_main_hal_cback event: HAL_NFC_OPEN_CPLT_EVT(0x0), status=1
D/NxpHal ( 894): Failed to deallocate (list empty)
D/NxpHal ( 894): Node dump:
D/NxpHal ( 894): Failed to deallocate (list empty)
D/NxpHal ( 894): Node dump:
…
The pn5xx_i2c device node should usually appear with the following rights:
If this is not the case, refer to related procedure chapter Section 4.4.5, Section 4.5.5,
Section 4.6.5, Section 4.7.5 or Section 4.8.5.
Additionally, in case the platform implements Security-Enhanced Linux in Android,
pn5xx_i2c device node must be declared as NFC device. This is done adding the
following definition inside device/brand/platform/sepolicy/file_contexts file:
/dev/pn544 u:object_r:nfc_device:s0
…
D/BrcmNfcJni( 893): PowerSwitch::initialize: level=PS-FULL (1)
D/NfcAdaptation( 893): bool CNfcConfig::readConfig(const char*, bool) Cannot open config
file /etc/libnfc-brcm.conf
D/NfcAdaptation( 893): bool CNfcConfig::readConfig(const char*, bool) Using default value
for all settings
D/BrcmNfcJni( 893): PowerSwitch::initialize: desired screen-off state=1
D/NfcAdaptation( 893): NfcAdaptation::Initialize: enter
E/NfcAdaptation( 893): NfcAdaptation::Initialize: ver=NFCDROID-AOSP_L_00.01
nfa=NFA_PI_1.03.66+
D/BrcmNfcJni( 893): initializeGlobalAppLogLevel: level=5
D/NfcAdaptation( 893): NfcAdaptation::NFCA_TASK: enter
I/BrcmNfcNfa( 893): GKI_run(): Start/Stop GKI_timer_update_registered!
D/NfcAdaptation( 893): NfcAdaptation::Thread: enter
I/BrcmNfcNfa( 893): NFC_TASK started.
D/NfcAdaptation( 893): NfcAdaptation::InitializeHalDeviceContext: enter
E/NfcAdaptation( 893): No HAL module specified in config, falling back to BCM2079x
E/NfcAdaptation( 893): NfcAdaptation::InitializeHalDeviceContext: fail hw_get_module
nfc_nci.bcm2079x
D/NfcAdaptation( 893): NfcAdaptation::InitializeHalDeviceContext: exit
D/NfcAdaptation( 893): NfcAdaptation::Initialize: exit
I/BrcmNfcNfa( 893): NFA_Init ()
I/BrcmNfcNfa( 893): nfa_dm_init ()
…
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
If this is not the case, refer to related procedure Section 4.3.4, Section 4.7.4 or
Section 4.8.6.
…
I/BrcmNfcNfa( 2609): NFC_TASK started.
D/NfcAdaptation( 2609): NfcAdaptation::Thread: exit
D/NfcAdaptation( 2609): NfcAdaptation::InitializeHalDeviceContext: enter
D/NfcAdaptation( 2609): const CNfcParam* CNfcConfig::find(const char*) const found
NCI_HAL_MODULE=nfc_nci.pn54x
E/NfcAdaptation( 2609): NfcAdaptation::InitializeHalDeviceContext: fail hw_get_module
nfc_nci.pn54x
D/NfcAdaptation( 2609): NfcAdaptation::InitializeHalDeviceContext: exit
D/NfcAdaptation( 2609): NfcAdaptation::Initialize: exit
…
You can then either flash the newly created system.img or just copy the library to the
android target:
…
D/NxpTml (25279): PN54X - Write requested.....
D/NxpTml (25279): PN54X - Invoking I2C Write.....
D/NxpTml (25279): PN54X - Read requested.....
D/NxpTml (25279): PN54X - Invoking I2C Read.....
D/NxpNciX (25279): len = 10 > 20020702310100380101
D/NxpTml (25279): PN54X - I2C Write successful.....
D/NxpTml (25279): PN54X - Posting Fresh Write message.....
D/NxpTml (25279): PN54X - Tml Writer Thread Running................
D/NxpHal (25279): write successful status = 0x0
D/NxpTml (25279): PN54X - I2C Read successful.....
D/NxpNciR (25279): len = 4 > 40020106
D/NxpTml (25279): PN54X - Posting read message.....
D/NxpHal (25279): read successful status = 0x0
D/NxpHal (25279): > Deinit for LLCP set_config 0x0 0x0 0x0
D/NxpHal (25279): phNxpNciHal_print_res_status: response status =STATUS_OK
…
If this is the case, refer to related procedure chapter Section 4.3.2, Section 4.7.2 or
Section 4.8.3.
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
…
W ActivityManager: Re-adding persistent process ProcessRecord{f8a0220
28966:com.android.nfc/1027}
I ActivityManager: Start proc 28995:com.android.nfc/1027 for restart com.android.nfc
I com.android.nf: ConfigFile - Parsing file '/etc/libnfc-nci.conf'
I com.android.nf: ConfigFile - [NFA_STORAGE] = "/data/vendor/nfc"
I com.android.nf: ConfigFile - [NCI_HAL_MODULE] = "nfc_nci.pn54x"
I hwservicemanager: getTransport: Cannot find entry [email protected]::INxpNfc/default
in either framework or device manifest.
I hwservicemanager: getTransport: Cannot find entry [email protected]::INfc/default
in either framework or device manifest.
I hwservicemanager: getTransport: Cannot find entry [email protected]::INfc/default
in either framework or device manifest.
I hwservicemanager: getTransport: Cannot find entry [email protected]::INfc/default
in either framework or device manifest.
F libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 28995
(com.android.nfc), pid 28995 (com.android.nfc)
F DEBUG : pid: 28995, tid: 28995, name: com.android.nfc >>> com.android.nfc <<<
F DEBUG : #00 pc 00000000000ad8c8 /system/lib64/libnfc-nci.so
(NfcAdaptation::InitializeHalDeviceContext()+1736) (BuildId:
bc889132110efe73c4fc9e58e8776b54)
F DEBUG : #1 pc 00000000000ad1dc /system/lib64/libnfc-nci.so
…
Make sure the related libraries are present on the target and also properly declared in
manifest file (/vendor/etc/vintf/manifest.xml).
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
8 Legal information
Export control — This document as well as the item(s) described herein
may be subject to export control regulations. Export might require a prior
8.1 Definitions authorization from competent authorities.
Draft — A draft status on a document indicates that the content is still Evaluation products — This product is provided on an “as is” and “with all
under internal review and subject to formal approval, which may result faults” basis for evaluation purposes only. NXP Semiconductors, its affiliates
in modifications or additions. NXP Semiconductors does not give any and their suppliers expressly disclaim all warranties, whether express,
representations or warranties as to the accuracy or completeness of implied or statutory, including but not limited to the implied warranties of
information included in a draft version of a document and shall have no non-infringement, merchantability and fitness for a particular purpose. The
liability for the consequences of use of such information. entire risk as to the quality, or arising out of the use or performance, of this
product remains with customer. In no event shall NXP Semiconductors, its
affiliates or their suppliers be liable to customer for any special, indirect,
consequential, punitive or incidental damages (including without limitation
8.2 Disclaimers damages for loss of business, business interruption, loss of use, loss of
data or information, and the like) arising out the use of or inability to use
the product, whether or not based on tort (including negligence), strict
Limited warranty and liability — Information in this document is believed liability, breach of contract, breach of warranty or any other theory, even if
to be accurate and reliable. However, NXP Semiconductors does not advised of the possibility of such damages. Notwithstanding any damages
give any representations or warranties, expressed or implied, as to the that customer might incur for any reason whatsoever (including without
accuracy or completeness of such information and shall have no liability limitation, all damages referenced above and all direct or general damages),
for the consequences of use of such information. NXP Semiconductors the entire liability of NXP Semiconductors, its affiliates and their suppliers
takes no responsibility for the content in this document if provided by an and customer’s exclusive remedy for all of the foregoing shall be limited to
information source outside of NXP Semiconductors. In no event shall NXP actual damages incurred by customer based on reasonable reliance up to
Semiconductors be liable for any indirect, incidental, punitive, special or the greater of the amount actually paid by customer for the product or five
consequential damages (including - without limitation - lost profits, lost dollars (US$5.00). The foregoing limitations, exclusions and disclaimers shall
savings, business interruption, costs related to the removal or replacement apply to the maximum extent permitted by applicable law, even if any remedy
of any products or rework charges) whether or not such damages are based fails of its essential purpose.
on tort (including negligence), warranty, breach of contract or any other
legal theory. Notwithstanding any damages that customer might incur for
Translations — A non-English (translated) version of a document is for
any reason whatsoever, NXP Semiconductors’ aggregate and cumulative
reference only. The English version shall prevail in case of any discrepancy
liability towards customer for the products described herein shall be limited
between the translated and English versions.
in accordance with the Terms and conditions of commercial sale of NXP
Semiconductors.
Security — Customer understands that all NXP products may be subject
to unidentified or documented vulnerabilities. Customer is responsible
Right to make changes — NXP Semiconductors reserves the right to
for the design and operation of its applications and products throughout
make changes to information published in this document, including without
their lifecycles to reduce the effect of these vulnerabilities on customer’s
limitation specifications and product descriptions, at any time and without
applications and products. Customer’s responsibility also extends to other
notice. This document supersedes and replaces all information supplied prior
open and/or proprietary technologies supported by NXP products for use
to the publication hereof.
in customer’s applications. NXP accepts no liability for any vulnerability.
Customer should regularly check security updates from NXP and follow up
Suitability for use — NXP Semiconductors products are not designed, appropriately. Customer shall select products with security features that best
authorized or warranted to be suitable for use in life support, life-critical or meet rules, regulations, and standards of the intended application and make
safety-critical systems or equipment, nor in applications where failure or the ultimate design decisions regarding its products and is solely responsible
malfunction of an NXP Semiconductors product can reasonably be expected for compliance with all legal, regulatory, and security related requirements
to result in personal injury, death or severe property or environmental concerning its products, regardless of any information or support that may
damage. NXP Semiconductors and its suppliers accept no liability for be provided by NXP. NXP has a Product Security Incident Response Team
inclusion and/or use of NXP Semiconductors products in such equipment or (PSIRT) (reachable at [email protected]) that manages the investigation,
applications and therefore such inclusion and/or use is at the customer’s own reporting, and solution release to security vulnerabilities of NXP products.
risk.
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
Tables
Tab. 1. Tag list of libnfc-nci.conf file ............................ 29 Tab. 5. Tag list of libnfc-nxp_RF.conf file .....................32
Tab. 2. Tag list of libnfc-nxp.conf file ........................... 29 Tab. 6. Tag list of libnfc-brcm.conf file ......................... 32
Tab. 3. Tag list of libnfc-brcm.conf file ......................... 31 Tab. 7. Tag list of libnfc-nxp.conf file ........................... 33
Tab. 4. Tag list of libnfc-nxp.conf file ........................... 31
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
Figures
Fig. 1. Android NFC stack overview .............................3 Fig. 2. Running Factory Test native application on
Android target ..................................................35
AN11690 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2020. All rights reserved.
Contents
1 Revision history .................................................. 2 4.6.2 Step 2: installing NXP-NCI delivery ................. 19
2 Introduction ......................................................... 3 4.6.3 Step 3: updating configuration files ..................20
3 Kernel driver ........................................................4 4.6.4 Step 4: adding NFC to the build ...................... 20
3.1 Driver details ......................................................4 4.6.5 Step 5: changing device owner and
3.2 Installation instructions ...................................... 4 permissions ......................................................21
3.2.1 Getting the driver ...............................................4 4.6.6 Step 6: building and installing NFC ................. 21
3.2.2 Including the driver to the kernel ....................... 4 4.6.7 Step 7: verifying NFC functionality ...................21
3.2.3 Creating the device node .................................. 4 4.7 Android Lollipop ............................................... 22
3.2.3.1 Device tree ........................................................ 5 4.7.1 Step 1: retrieving NXP-NCI NFC delivery ........ 22
3.2.3.2 Platform data ..................................................... 5 4.7.2 Step 2: installing NXP-NCI delivery ................. 22
3.2.4 Building the driver ..............................................6 4.7.3 Step 3: updating configuration files ..................23
4 AOSP adaptation .................................................7 4.7.4 Step 4: adding NFC to the build ...................... 23
4.1 Android R ...........................................................7 4.7.5 Step 5: changing device owner and
4.1.1 Step 1: retrieving NXP-NCI NFC delivery .......... 7 permissions ......................................................23
4.1.2 Step 2: installing NXP-NCI delivery ................... 7 4.7.6 Step 6: building and installing NFC ................. 23
4.1.3 Step 3: updating configuration files ................... 7 4.7.7 Step 7: verifying NFC functionality ...................24
4.1.4 Step 4: adding NFC to the build ........................ 8 4.8 Android KitKat ..................................................25
4.1.5 Step 5: building and installing NFC ................... 8 4.8.1 Step 1: getting the release package ................ 25
4.1.6 Step 6: verifying NFC functionality .................... 8 4.8.2 Step 2: merging files ....................................... 25
4.2 Android Q .......................................................... 9 4.8.3 Step 3: selecting the NFC Controller ............... 25
4.2.1 Step 1: retrieving NXP-NCI NFC delivery .......... 9 4.8.4 Step 4: adding NFC to the build ...................... 26
4.2.2 Step 2: installing NXP-NCI delivery ................... 9 4.8.5 Step 5: changing device owner and
4.2.3 Step 3: updating configuration files ................... 9 permissions ......................................................26
4.2.4 Step 4: adding NFC to the build ...................... 10 4.8.6 Step 6: building and installing NFC ................. 26
4.2.5 Step 5: building and installing NFC ................. 10 4.8.7 Step 7: verifying NFC functionality ...................27
4.2.6 Step 6: verifying NFC functionality ...................10 4.9 Others Android versions .................................. 28
4.3 Android Pie ...................................................... 11 5 Configuration files ............................................ 29
4.3.1 Step 1: retrieving NXP-NCI NFC delivery ........ 11 5.1 Android R, Q and Pie ...................................... 29
4.3.2 Step 2: installing NXP-NCI delivery ................. 11 5.2 Android Oreo ................................................... 30
4.3.3 Step 3: updating configuration files ..................11 5.3 Android Nougat and previous versions ............ 32
4.3.4 Step 4: adding NFC to the build ...................... 11 6 Factory test native application ........................ 35
4.3.5 Step 5: building and installing NFC ................. 11 7 Troubleshooting ................................................ 36
4.3.6 Step 6: verifying NFC functionality ...................12 7.1 Device node rights ...........................................36
4.4 Android Oreo ................................................... 13 7.2 Configuration files ............................................ 36
4.4.1 Step 1: retrieving NXP-NCI NFC delivery ........ 13 7.3 NXP’s NFC library ........................................... 37
4.4.2 Step 2: installing NXP-NCI delivery ................. 14 7.4 NFC Controller choice ..................................... 37
4.4.3 Step 3: updating configuration files ..................14 7.5 Missing modules .............................................. 38
4.4.4 Step 4: adding NFC to the build ...................... 14 7.6 VTS testing ...................................................... 38
4.4.5 Step 5: changing device owner and 7.6.1 Wrong interface ............................................... 38
permissions ......................................................15 7.6.2 Missing declaration .......................................... 38
4.4.6 Step 6: building and installing NFC ................. 15 7.6.3 Wrong vendor properties namespace ..............38
4.4.7 Step 7: verifying NFC functionality ...................15 8 Legal information .............................................. 39
4.5 Android Nougat ................................................16
4.5.1 Step 1: retrieving NXP-NCI NFC delivery ........ 16
4.5.2 Step 2: installing NXP-NCI delivery ................. 16
4.5.3 Step 3: updating configuration files ..................17
4.5.4 Step 4: adding NFC to the build ...................... 17
4.5.5 Step 5: changing device owner and
permissions ......................................................18
4.5.6 Step 6: building and installing NFC ................. 18
4.5.7 Step 7: verifying NFC functionality ...................18
4.6 Android Marshmallow ...................................... 19
4.6.1 Step 1: retrieving NXP-NCI NFC delivery ........ 19
Please be aware that important notices concerning this document and the product(s)
described herein, have been included in section 'Legal information'.