NFC

NFC Drivers Location
NFC driver and are hosted at  under the folder libnfc-ti. under the folder Nfc. under the folder drivers/Nfc.

Building NFC modules
Set the following environment variables,

run. ./build/envsetup.sh lunch choose the platform to build for

Build the drivers by providing this simple make command,

go to external/libnfc-ti/ mm -B go to packages/apps/Nfc mm -B

Modules built
Following shared libraries and apps will be generated,

out/target/product/omap5sevm/system/lib/libnfc_ndef.so out/target/product/omap5sevm/system/lib/libnfc.so out/target/product/omap5sevm/system/app/Nfc.apk out/target/product/omap5sevm/system/lib/libnfc_jni.so

Module insertion
The below mentioned modules need to be installed into the /system/lib/ and /system/app of the target AFS,

cp -v   out/target/product/omap5sevm/system/lib/libnfc_ndef.so $TARGET_FS/system/lib/ cp -v   out/target/product/omap5sevm/system/lib/libnfc.so      $TARGET_FS/system/lib/ cp -v   out/target/product/omap5sevm/system/lib/libnfc_jni.so  $TARGET_FS/system/lib/ cp -v   out/target/product/omap5sevm/system/app/Nfc.apk        $TARGET_FS/system/app/

Modification needed to device.mk and init.rc file
Make sure the following entries in the device.mk file frameworks/base/data/etc/android.hardware.nfc.xml:system/etc/permissions/android.hardware.nfc.xml \ frameworks/base/nfc-extras/com.android.nfc_extras.xml:system/etc/permissions/com.android.nfcextras.xml \ device/sample/nxp/com.nxp.mifare.xml:system/etc/permissions/com.nxp.mifare.xml \ device/ti/omap5sevm/nfcee_access.xml:system/etc/nfcee_access.xml \

Make sure to set the proper permissions to nfc dev node /dev/nfc                 0666   system    system

Necessity of libnfc-ti & Switching back to libnfc-nxp
libnfc-ti is NCI complaint TI NFC stack built on top of libnfc-nxp. To switch a product from libnfc-ti to use libnfc-nxp, You can follow these steps:  BLUETI_ENHANCEMENT compile time switch By enabling the below mentioned change, TI NFC components starts to get built. diff --git a/BoardConfig.mk b/BoardConfig.mk index 8834375..4434394 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -19,6 +19,7 @@ BOARD_USES_GENERIC_AUDIO := false USE_CAMERA_STUB := true OMAP_ENHANCEMENT := true +BLUETI_ENHANCEMENT := true +NFC_TI_DEVICE := true ifdef OMAP_ENHANCEMENT COMMON_GLOBAL_CFLAGS += -DOMAP_ENHANCEMENT -DTARGET_OMAP4 ifdef OMAP_ENHANCEMENT_S3D COMMON_GLOBAL_CFLAGS += -DOMAP_ENHANCEMENT_S3D endif +ifdef NFC_TI_DEVICE +COMMON_GLOBAL_CFLAGS += -DNFC_JNI_TI_DEVICE

Enable the following in your system.prop or built build.prop to enable the runtime components of blueti_enhancement to be true, diff --git a/system.prop b/system.prop index ddc52b1..99711bd 100644 --- a/system.prop +++ b/system.prop @@ -1,2 +1,3 @@ wifi.interface=wlan0 public static final boolean NFCTI_ENHANCEMENT = native_get_boolean("com.ti.nfcti_enhancement", true);  check up on the manifest  Check whether the following trees are being repo-synced to your source code via the manifests? +<! TI NFC trees -->  +  build NFC driver in kernel  The following change in your local defconfig of the kernel should allow wl_nfc to be built as kernel image, +menuconfig NFC_DEVICES +      bool "Near Field Communication (NFC) devices" +      default n +       ---help--- +      You'll have to say Y if your computer contains an NFC device that +      you want to use under Linux. + +      You can say N here if you don't have any Near Field Communication +      devices connected to your computer. + +if NFC_DEVICES

+config ST_NFC +   tristate "Texas Instruments ST nfc driver" +      depends on TI_ST +   help +     This enables the NFC driver for TI WL128x BT/FM/GPS/NFC combo devices. +     It will provide a character device for the TI NFC host software to +      access the NFC core on the WL128x. + +endif

Add the following entries in your Make file +obj-$(CONFIG_ST_NFC)          += wl_nfc.o

Enable the ST driver guard in the omap defconfig +CONFIG_NFC_DEVICES=y +CONFIG_ST_NFC=y