AN13189
AN13189
AN13189
Document information
Information Content
Keywords Android, NFC, NXP, NCI, PN7160
Abstract This application note describes how to add support for PN7160 NXP NCI-based NFC controller to
an Android system.
NXP Semiconductors
AN13189
PN7160 Android porting guide
1 Revision history
Revision history
Rev Date Description
1.8 20230315 Section 3 "Security fixes": added
1.7 20221215 Section 5.1 "Android 13": added
1.6 20220224 Adding firmware update procedure details (Section 5.2.5 and Section 5.3.5)
1.5 20220201 Adding Android12 support
1.4 20210916 Typo error in repository address fixed
1.3 20210913 Security status changed into "Company public", no content change
1.2 20210820 Security status changed into "Company restricted"
1.1 20210709 Updated with SPI support, FW update, NDEF emulation support and DTA application
1.0 20210324 Initial release
AN13189 All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
2 Introduction
This document provides guidelines for the integration of PN7160 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 for adding the support of PN7160 NFC controller. Figure 1 shows the architecture
of the whole Android NFC stack.
• The nxpnfc 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
• The JNI is a glue code between Java and Native classes
• The NFC service is the application framework module providing access to NFC functionality
AN13189 All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
3 Security fixes
Important notice:
The customer must integrate following security fixes. NXP will support them from next Android release.
CVE-2022-20471: https://android.googlesource.com/platform/hardware/nxp/nfc/
+/1164ee536ecf6504e73dcaac0ccb1ee887f3a19c
CVE-2023-20945: https://android.googlesource.com/platform/packages/apps/Nfc/
+/4a964908ff0bd91d93f96cdc26f7377420c58273
AN13189 All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
4 Kernel driver
The NFC Android stack uses nxpnfc kernel driver to communicate with the NXP NCI NFC controller. It is
available from the following repository: https://github.com/NXPNFCLinux/nxpnfc.
$ rm -rf drivers/nfc
$ git clone https://github.com/NXPNFCLinux/nxpnfc.git drivers/nfc
This will end-up with the folder drivers/nfc containing the following files:
• README.md: repository information
• Makefile: driver heading makefile
• Kconfig: driver configuration file
• LICENSE: driver licensing terms
2
• i2c_devicetree.txt: example of I C device tree definition
• spi_devicetree.txt: example of SPI device tree definition
• nfc sub folder containing:
– Makefile:
– common.c: generic driver implementation
– common.h: generic driver interface definition
2
– i2c.c: I C-specific driver implementation
2
– i2c.h: I C-specific driver interface definition
– spi.c: SPI-specific driver implementation
– spi.h: SPI-specific driver interface definition
2
4.3.1 I C version
2
I C address (0x28 in below examples) and GPIO assignments must be adapted according to the hardware
integration in the platform.
AN13189 All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. 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 subfolder for arm-based platform).
i2c0: i2c@ffd71000 {
...
status = "ok";
nxpnfc: nxpnfc@28 {
compatible = "nxp,nxpnfc";
reg = <0x28>;
nxp,nxpnfc-irq = <&gpio26 0 0>;
nxp,nxpnfc-ven = <&gpio26 2 0>;
nxp,nxpnfc-fw-dwnld = <&gpio26 4 0>;
};
};
spi2: spi@ffd68000 {
...
status = "ok";
nxpnfc@0 {
compatible = "nxp,nxpnfc";
reg = <0>;
nxp,nxpnfc-irq = <&gpio26 0 0>;
nxp,nxpnfc-ven = <&gpio26 2 0>;
nxp,nxpnfc-fw-dwnld = <&gpio26 4 0>;
spi-max-frequency = <7000000>;
};
};
Rebuilding the complete kernel, the driver will be included in the kernel image.
AN13189 All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
5 AOSP adaptation
5.1 Android 13
Below step-by-step procedure is based on NXP’s Android NFC delivery from https://github.com/NXPNFCLinux/
nxpnfc_android13 repository.
The current release is based on Android AOSP version 13.0.0_r3, porting to other Android 13 subversion may
require minor adaptation of API (detected when compiling).
$ ${ANDROID_BUILD_TOP}/vendor/nxp/nfc/install_NFC.sh
This will:
• Patch the AOSP system/nfc implementation to add PN7160 specific support
• Patch the AOSP hardware/nxp/nfc implementation to add PN7160 specific support
• Patch the AOSP packages/apps/Nfc folder to add support for PN7160 extensions
• Patch the AOSP frameworks/base definitions to add specific API
• Patch the AOSP frameworks/native definitions to add specific permissions
• Patch the vendor/nxp folder to add specific API for T4T NDEF emulation
• Patch the AOSP build/make folder to avoid warnings when building image
• Patch the AOSP hardware/interface definitions to add specific interface
• Patch the AOSP system/core folder to force remounting partitions
AN13189 All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
-include vendor/nxp/nfc/BoardConfigNfc.mk
This creates vendor/nxp/pn7160/firmware subfolder containing 32 bits and 64 bits Arm architecture libraries.
Those libraries will be included in the image when building the android image (as defined within vendor/nxp/nfc/
device-nfc.mk).
5.2 Android 12
Below step-by-step procedure is based on NXP’s Android NFC delivery from https://github.com/NXPNFCLinux/
nxpnfc_android12 repository.
The current release is based on Android AOSP version 12.0.0_r9, porting to other Android 12 subversion may
require minor adaptation of API (detected when compiling).
$ ${ANDROID_BUILD_TOP}/vendor/nxp/nfc/install_NFC.sh
This will:
AN13189 All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
-include vendor/nxp/nfc/BoardConfigNfc.mk
This creates vendor/nxp/pn7160/firmware subfolder containing 32 bits and 64 bits Arm architecture libraries.
Those libraries will be included in the image when building the android image (as defined within vendor/nxp/nfc/
device-nfc.mk).
AN13189 All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
5.3 Android 11
Below step-by-step procedure is based on NXP’s Android NFC delivery from https://github.com/NXPNFCLinux/
nxpnfc_android11 repository.
The current release is based on Android AOSP version 11.0.0_r3, porting to other Android 11 subversion may
require minor adaptation of API (detected when compiling).
$ ${ANDROID_BUILD_TOP}/vendor/nxp/nfc/install_NFC.sh
This will:
• Patch the AOSP system/nfc implementation to add PN7160 specific support
• Patch the AOSP hardware/nxp/nfc implementation to add PN7160 specific support
• Patch the AOSP packages/apps/Nfc folder to add support for PN7160 extensions
• Patch the AOSP frameworks/base definitions to add specific API
• Patch the AOSP frameworks/native definitions to add specific permissions
• Patch the vendor/nxp folder to add specific API for T4T NDEF emulation
AN13189 All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
-include vendor/nxp/nfc/BoardConfigNfc.mk
This creates vendor/nxp/pn7160/firmware subfolder containing 32 bits and 64 bits Arm architecture libraries.
Those libraries will be included in the image when building the android image (as defined within vendor/nxp/nfc/
device-nfc.mk).
AN13189 All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
6 Configuration files
Two files allow configuring the libnfc-nci library at runtime: libnfc-nci.conf and libnfc-nxp.conf. There are defining
tags which are impacting library behavior. The value of the tags depends on the NFC Controller IC and the
targeted platform. For more details, refer to the examples given in vendor/nxp/nfc/hw/pn7160 subfolder of the
NXP's Android NFC delivery (see Section 5.2.3 or Section 5.3.3).
These files are loaded by the library respectively from /system/etc and /vendor/etc directories of the target,
during the NFC initialization phase.
Pay attention that the configuration files provided as example relate to the NFC Controller demo board.
These files must be adapted according to the targeted integration.
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).
AN13189 All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
AN13189 All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
$ mmm vendor/nxp/nfc/FactoryTestApp
On the Android target, update the file rights to allow execution and, after making sure that the NFC service is
disabled (in “Settings” application NFC must be off, or else you can disable it using command "adb shell svc nfc
disable"), run the application:
AN13189 All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
After flashing the target, the DTA application should then be present from the list of installed applications.
When started, the DTA application requests user to disable NFC function from the "settings" menu. Indeed, DTA
application directly access the NFC function from the low-level libraries, thus NFC service must be disabled to
prevent conflicts.
AN13189 All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
AN13189 All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
$ mmm vendor/nxp/nfc/T4TDemo
On the Android target, the T4TDemo is then visible in the list of applications. Run it by clicking the related icon:
AN13189 All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
10 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 NxpExtns: find found NXP_NFC_DEV_NODE=/dev/nxpnfc
D NxpTml : getTransport Requested transportType: 2
D NxpTml : OpenAndConfigure Opening port=/dev/nxpnfc
E NxpTml : _i2c_open() Failed: retval ffffffff
E NxpHal : phTmlNfc_Init Failed
D NxpHal : Failed to deallocate (list empty)
D NxpHal : Node dump:
D NxpHal : Failed to deallocate (list empty)
D NxpHal : Node dump:
E NxpHal : phNxpNciHal_MinOpen failed
E NxpHal : nxpncihal_monitor is null
…
The nxpnfc device node should usually appear with the following rights:
If not listed in the /dev folder, it means the module is not properly loaded as depicted in Section 4.3. Check
kernel logs to see if error occurs during the module load or refer to the device tree definition.
In case the device node is seen with wrong rights, check the correct definition is present in /vendor/etc/init/
init.TargetProduct.nfc.rc file:
…
I com.android.nf: [0224/072605.700111:INFO:NfcJniUtil.cpp(47)] NFC Service: loading nci JNI
I com.android.nf: loadConfigEntry
F com.android.nf: nfc_config.cc:93] Check failed: config_path != ""
F com.android.nf: runtime.cc:655] Runtime aborting...
F com.android.nf: runtime.cc:655] Dumping all threads without mutator lock held
F com.android.nf: runtime.cc:655] All threads:
F com.android.nf: runtime.cc:655] DALVIK THREADS (17):
F com.android.nf: runtime.cc:655] "main" prio=5 tid=1 Runnable
F com.android.nf: runtime.cc:655] | group="" sCount=0 dsCount=0 flags=0 obj=0x7215b448 self=0xb40000748b64f010
…
The libnfc-nci.conf configuration file should be present in the android system under /system/etc, if this is not the
case, refer to related procedure in Section 5.2.4 or Section 5.3.4.
AN13189 All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
The following ADB logs may indicate the absence of the libnfc-nxp.conf file:
…
I com.android.nf: [0224/072835.710998:INFO:NfcJniUtil.cpp(47)] NFC Service: loading nci JNI
I com.android.nf: loadConfigEntry
I com.android.nf: ConfigFile - Parsing file '/etc/libnfc-nci.conf'
I com.android.nf: ConfigFile - [APPL_TRACE_LEVEL] = 0xFF
I com.android.nf: ConfigFile - [PROTOCOL_TRACE_LEVEL] = 0xFFFFFFFF
I com.android.nf: ConfigFile - [NFC_DEBUG_ENABLED] = 0x01
I com.android.nf: ConfigFile - [NFA_STORAGE] = "/data/vendor/nfc"
I com.android.nf: ConfigFile - [HOST_LISTEN_TECH_MASK] = 0x07
I com.android.nf: ConfigFile - [SCREEN_OFF_POWER_STATE] = 1
I com.android.nf: ConfigFile - [NCI_HAL_MODULE] = "nfc_nci.pn54x"
I com.android.nf: ConfigFile - [POLLING_TECH_MASK] = 0xEF
I com.android.nf: ConfigFile - [P2P_LISTEN_TECH_MASK] = 0xC5
I com.android.nf: ConfigFile - [PRESERVE_STORAGE] = 0x01
I com.android.nf: ConfigFile - [AID_MATCHING_MODE] = 0x03
I com.android.nf: [0224/072835.713008:INFO:NfcAdaptation.cc(633)] Failed to retrieve the NXP NFC HAL!
I com.android.nf: [0224/072835.713158:INFO:NfcAdaptation.cc(639)] NfcAdaptation::InitializeHalDeviceContext:
INfc::getService()
I com.android.nf: [0224/072835.714035:INFO:NfcAdaptation.cc(650)] NfcAdaptation::InitializeHalDeviceContext:
INfc::getService() returned 0xb4000077ae5bc710 (remote)
I com.android.nf: [0224/072835.714403:INFO:NfcAdaptation.cc(657)] NfcAdaptation::InitializeHalDeviceContext:
INfc::getService() returned 0xb4000077ae5bc710 (remote)
…
The libnfc-nxp.conf configuration file should be present in the android system under /vendor/etc, if this is not the
case, refer to related procedure in Section 5.2.4 or Section 5.3.4.
…
I NfcService: Starting NFC service
D AndroidRuntime: Shutting down VM
E AndroidRuntime: FATAL EXCEPTION: main
E AndroidRuntime: Process: com.android.nfc, PID: 3503
E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "libnfc_nci_jni.so" not found
E AndroidRuntime: at java.lang.Runtime.loadLibrary0(Runtime.java:1087)
E AndroidRuntime: at java.lang.Runtime.loadLibrary0(Runtime.java:1008)
E AndroidRuntime: at java.lang.System.loadLibrary(System.java:1664)
E AndroidRuntime: at com.android.nfc.dhimpl.NativeNfcManager.<clinit>(NativeNfcManager.java:47)
E AndroidRuntime: at com.android.nfc.NfcService.<init>(NfcService.java:438)
E AndroidRuntime: at com.android.nfc.NfcApplication.onCreate(NfcApplication.java:66)
E AndroidRuntime: at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192)
E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6712)
E AndroidRuntime: at android.app.ActivityThread.access$1300(ActivityThread.java:237)
E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
E AndroidRuntime: at android.os.Looper.loop(Looper.java:223)
E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7656)
E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
The library should be located under /system/lib/hw android target subdirectory (or under /system/lib64/hw if the
platform is 64 bits).
$ croot
AN13189 All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
$ mmm system/nfc
$ mmm package/apps/Nfc
$ make systemimage
You can then either flash the newly created system.img or just copy the library to the android target:
…
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 vendor.nxp.nxpnfc@1.0::INxpNfc/default in either framework or
device manifest.
I hwservicemanager: getTransport: Cannot find entry android.hardware.nfc@1.2::INfc/default in either framework or
device manifest.
I hwservicemanager: getTransport: Cannot find entry android.hardware.nfc@1.1::INfc/default in either framework or
device manifest.
I hwservicemanager: getTransport: Cannot find entry android.hardware.nfc@1.0::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 that the related libraries are present on the target and also properly declared in manifest file (/
vendor/etc/vintf/manifest.xml).
“nfc-nci” interface must be undefined from “fqname” tag inside /vendor/etc/vintf/manifest.xml file.
AN13189 All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
AN13189 All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
11 Legal information
11.1 Definitions Terms and conditions of commercial sale — NXP Semiconductors
products are sold subject to the general terms and conditions of commercial
sale, as published at http://www.nxp.com/profile/terms, unless otherwise
Draft — A draft status on a document indicates that the content is still agreed in a valid written individual agreement. In case an individual
under internal review and subject to formal approval, which may result agreement is concluded only the terms and conditions of the respective
in modifications or additions. NXP Semiconductors does not give any agreement shall apply. NXP Semiconductors hereby expressly objects to
representations or warranties as to the accuracy or completeness of applying the customer’s general terms and conditions with regard to the
information included in a draft version of a document and shall have no purchase of NXP Semiconductors products by customer.
liability for the consequences of use of such 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
11.2 Disclaimers authorization from competent authorities.
Limited warranty and liability — Information in this document is believed Evaluation products — This product is provided on an “as is” and “with all
to be accurate and reliable. However, NXP Semiconductors does not give faults” basis for evaluation purposes only. NXP Semiconductors, its affiliates
any representations or warranties, expressed or implied, as to the accuracy and their suppliers expressly disclaim all warranties, whether express,
or completeness of such information and shall have no liability for the implied or statutory, including but not limited to the implied warranties of non-
consequences of use of such information. NXP Semiconductors takes no infringement, merchantability and fitness for a particular purpose. The entire
responsibility for the content in this document if provided by an information risk as to the quality, or arising out of the use or performance, of this product
source outside of NXP Semiconductors. remains with customer.
In no event shall NXP Semiconductors be liable for any indirect, incidental, In no event shall NXP Semiconductors, its affiliates or their suppliers
punitive, special or consequential damages (including - without limitation - be liable to customer for any special, indirect, consequential, punitive
lost profits, lost savings, business interruption, costs related to the removal or incidental damages (including without limitation damages for loss of
or replacement of any products or rework charges) whether or not such business, business interruption, loss of use, loss of data or information, and
damages are based on tort (including negligence), warranty, breach of the like) arising out the use of or inability to use the product, whether or not
contract or any other legal theory. based on tort (including negligence), strict liability, breach of contract, breach
of warranty or any other theory, even if advised of the possibility of such
Notwithstanding any damages that customer might incur for any reason
damages.
whatsoever, NXP Semiconductors’ aggregate and cumulative liability
towards customer for the products described herein shall be limited in Notwithstanding any damages that customer might incur for any reason
accordance with the Terms and conditions of commercial sale of NXP whatsoever (including without limitation, all damages referenced above and
Semiconductors. all direct or general damages), the entire liability of NXP Semiconductors,
its affiliates and their suppliers and customer’s exclusive remedy for all of
the foregoing shall be limited to actual damages incurred by customer based
Right to make changes — NXP Semiconductors reserves the right to
on reasonable reliance up to the greater of the amount actually paid by
make changes to information published in this document, including without
customer for the product or five dollars (US$5.00). The foregoing limitations,
limitation specifications and product descriptions, at any time and without
exclusions and disclaimers shall apply to the maximum extent permitted by
notice. This document supersedes and replaces all information supplied prior
applicable law, even if any remedy fails of its essential purpose.
to the publication hereof.
Translations — A non-English (translated) version of a document, including
Suitability for use — NXP Semiconductors products are not designed,
the legal information in that document, is for reference only. The English
authorized or warranted to be suitable for use in life support, life-critical or
version shall prevail in case of any discrepancy between the translated and
safety-critical systems or equipment, nor in applications where failure or
English versions.
malfunction of an NXP Semiconductors product can reasonably be expected
to result in personal injury, death or severe property or environmental
damage. NXP Semiconductors and its suppliers accept no liability for Security — Customer understands that all NXP products may be subject to
inclusion and/or use of NXP Semiconductors products in such equipment or unidentified vulnerabilities or may support established security standards or
applications and therefore such inclusion and/or use is at the customer’s own specifications with known limitations. Customer is responsible for the design
risk. and operation of its applications and products throughout their lifecycles
to reduce the effect of these vulnerabilities on customer’s applications
and products. Customer’s responsibility also extends to other open and/or
Applications — Applications that are described herein for any of these
proprietary technologies supported by NXP products for use in customer’s
products are for illustrative purposes only. NXP Semiconductors makes no
applications. NXP accepts no liability for any vulnerability. Customer should
representation or warranty that such applications will be suitable for the
regularly check security updates from NXP and follow up appropriately.
specified use without further testing or modification.
Customer shall select products with security features that best meet rules,
Customers are responsible for the design and operation of their
regulations, and standards of the intended application and make the
applications and products using NXP Semiconductors products, and NXP
ultimate design decisions regarding its products and is solely responsible
Semiconductors accepts no liability for any assistance with applications or
for compliance with all legal, regulatory, and security related requirements
customer product design. It is customer’s sole responsibility to determine
concerning its products, regardless of any information or support that may be
whether the NXP Semiconductors product is suitable and fit for the
provided by NXP.
customer’s applications and products planned, as well as for the planned
application and use of customer’s third party customer(s). Customers should NXP has a Product Security Incident Response Team (PSIRT) (reachable
provide appropriate design and operating safeguards to minimize the risks at PSIRT@nxp.com) that manages the investigation, reporting, and solution
associated with their applications and products. release to security vulnerabilities of NXP products.
NXP Semiconductors does not accept any liability related to any default,
damage, costs or problem which is based on any weakness or default
in the customer’s applications or products, or the application or use by
customer’s third party customer(s). Customer is responsible for doing all
necessary testing for the customer’s applications and products using NXP
Semiconductors products in order to avoid a default of the applications
and the products or of the application or use by customer’s third party
customer(s). NXP does not accept any liability in this respect.
AN13189 All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
AN13189 All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Tables
Tab. 1. Tag list of libnfc-nci.conf file ............................ 12 Tab. 2. Tag list of libnfc-nxp.conf file ........................... 12
AN13189 All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Figures
Fig. 1. Android NFC stack overview .............................3 Fig. 3. DTA application ............................................... 16
Fig. 2. Running factory test native application on Fig. 4. Running T4TDemo application on Android
Android target ..................................................14 target ............................................................... 17
AN13189 All information provided in this document is subject to legal disclaimers. © 2023 NXP B.V. All rights reserved.
Contents
1 Revision history .................................................. 2
2 Introduction ......................................................... 3
3 Security fixes .......................................................4
4 Kernel driver ........................................................5
4.1 Driver details ......................................................5
4.2 Getting the source code .................................... 5
4.3 Including the driver into the kernel .....................5
4.3.1 I2C version ........................................................ 5
4.3.2 SPI version ........................................................ 6
4.4 Building the driver ..............................................6
5 AOSP adaptation .................................................7
5.1 Android 13 ......................................................... 7
5.1.1 Step 1: retrieving NXP's Android NFC
delivery ...............................................................7
5.1.2 Step 2: installing NXP-NCI delivery ................... 7
5.1.3 Step 3: updating configuration files ................... 7
5.1.4 Step 4: adding NFC to the build ........................ 7
5.1.5 Step 5: adding firmware libraries ....................... 8
5.1.6 Step 6: building and installing NFC ................... 8
5.1.7 Step 7: verifying NFC functionality .................... 8
5.2 Android 12 ......................................................... 8
5.2.1 Step 1: retrieving NXP's Android NFC
delivery ...............................................................8
5.2.2 Step 2: installing NXP-NCI delivery ................... 8
5.2.3 Step 3: updating configuration files ................... 9
5.2.4 Step 4: adding NFC to the build ........................ 9
5.2.5 Step 5: adding firmware libraries ....................... 9
5.2.6 Step 6: building and installing NFC ................... 9
5.2.7 Step 7: verifying NFC functionality ...................10
5.3 Android 11 ....................................................... 10
5.3.1 Step 1: retrieving NXP's Android NFC
delivery .............................................................10
5.3.2 Step 2: installing NXP-NCI delivery ................. 10
5.3.3 Step 3: updating configuration files ..................10
5.3.4 Step 4: adding NFC to the build ...................... 10
5.3.5 Step 5: adding firmware libraries ..................... 11
5.3.6 Step 6: building and installing NFC ................. 11
5.3.7 Step 7: verifying NFC functionality ...................11
6 Configuration files ............................................ 12
7 Factory test native application ........................ 14
8 NFC Forum DTA application ............................ 15
9 NDEF emulation T4TDemo application ........... 17
10 Troubleshooting ................................................ 18
10.1 Missing kernel driver or wrong device node
rights ................................................................ 18
10.2 Missing configuration files ............................... 18
10.3 Missing NXP’s NFC libraries ........................... 19
10.4 Missing modules .............................................. 20
10.5 VTS testing ...................................................... 20
10.5.1 Wrong interface ............................................... 20
10.5.2 Missing declaration .......................................... 20
10.5.3 Wrong vendor properties namespace ..............21
11 Legal information .............................................. 22
Please be aware that important notices concerning this document and the product(s)
described herein, have been included in section 'Legal information'.