kernel集成之后用NfcFactoryTestApp测试看是正常的。设置-> 已连接的设备-> 连接偏好设置-> NFC 下面是空的没有选项。看log有很多报错。有没有人在mtk平台上集成过nxp的模块,看下这是什么问题。
参考AN13189.pdf文档集成的https://www.nxp.com/docs/en/application-note/AN13189.pdf
Hi
From the log, I can see error message. did you follow AN13189 PN7160 android porting guider?
08-26 11:12:21.565 1996 1996 I com.android.nf: [0826/111221.565695:INFO:NfcAdaptation.cc(640)] Failed to retrieve the NXP NFC HAL!
Regards
Daniel
是的,我是按照文档中安卓12的步骤来移植的。对应的libnfc-nci.conf和libnfc-nxp.conf也有做修改
###############################################################################
# System clock source selection configuration
#define CLK_SRC_XTAL 1
#define CLK_SRC_PLL 2
NXP_SYS_CLK_SRC_SEL=0x01
现在板子上贴的是晶振,所以我配置的 1
有几个地方做了些修改,包括device-nfc.mk文件,原来的配置会导致进系统就重启进recovery。
修改如下:
diff --git a/hardware/interfaces/compatibility_matrices/compatibility_matrix.5.xml b/hardware/interfaces/compatibility_matrices/compatibility_matrix.5.xml
old mode 100644
new mode 100755
index 0fb21a7..6b99d79
--- a/hardware/interfaces/compatibility_matrices/compatibility_matrix.5.xml
+++ b/hardware/interfaces/compatibility_matrices/compatibility_matrix.5.xml
@@ -15,6 +15,14 @@
<instance>default</instance>
</interface>
</hal>
+ <hal format="hidl">
+ <name>vendor.nxp.nxpnfc</name>
+ <version>1.0</version>
+ <interface>
+ <name>INxpNfc</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
<hal format="hidl" optional="false">
<name>android.hardware.audio.effect</name>
<version>6.0</version>
diff --git a/device/mediatek/system/common/device.mk b/device/mediatek/system/common/device.mk
index 76498c6..00fa36e 100755
--- a/device/mediatek/system/common/device.mk
+++ b/device/mediatek/system/common/device.mk
@@ -4144,3 +4144,8 @@ PRODUCT_PACKAGES += \
ifeq ($(strip $(LZ_ADD_SCHEDULE_POWER_ON_OFF_APP)), yes)
PRODUCT_PACKAGES += SchedulePowerOnOff
endif
+
+## nxpnfc PN7160
+$(call inherit-product, vendor/nxp/nfc/device-nfc.mk)
+PRODUCT_PACKAGES += \
+ T4TDemo
\ No newline at end of file
diff --git a/device/mediateksample/tb8788p1_64_bsp_k419/BoardConfig.mk b/device/mediateksample/tb8788p1_64_bsp_k419/BoardConfig.mk
old mode 100644
new mode 100755
index a26df86..a9ba792
--- a/device/mediateksample/tb8788p1_64_bsp_k419/BoardConfig.mk
+++ b/device/mediateksample/tb8788p1_64_bsp_k419/BoardConfig.mk
@@ -36,4 +36,10 @@ endif
#add for microarray fingerprint sepolicy
ifeq (microarray_fp,$(strip $(CUSTOM_KERNEL_FINGERPRINT)))
BOARD_SEPOLICY_DIRS += vendor/microarrayfp/microarray_sepolicy
-endif
\ No newline at end of file
+endif
+
+##nxpnfc PN7160
+-include vendor/nxp/nfc/BoardConfigNfc.mk
+
+BOARD_SEPOLICY_DIRS += vendor/nxp/nfc/sepolicy \
+ vendor/nxp/nfc/sepolicy/nfc
\ No newline at end of file
diff --git a/device-nfc.mk b/device-nfc.mk
index fcdd060..e4195b0 100755
--- a/device-nfc.mk
+++ b/device-nfc.mk
@@ -27,17 +27,17 @@ PRODUCT_COPY_FILES += \
PRODUCT_COPY_FILES += \
vendor/$(NXP_VENDOR_DIR)/nfc/hw/init.$(NXP_NFC_PLATFORM).nfc.rc:vendor/etc/init/init.$(NXP_NFC_HOST).nfc.rc
# PN7160 firmware file
-ifeq ($(strip $(TARGET_NXP_NFC_HW)), pn7160)
+#ifeq ($(strip $(TARGET_NXP_NFC_HW)), pn7160)
PRODUCT_COPY_FILES += \
vendor/nxp/${NXP_NFC_HW}/firmware/lib64/libpn7160_fw.so:vendor/lib64/libpn7160_fw.so \
vendor/nxp/${NXP_NFC_HW}/firmware/lib/libpn7160_fw.so:vendor/lib/libpn7160_fw.so
-endif
+#endif
# NFC packages
PRODUCT_PACKAGES += \
libnfc-nci \
NfcNci \
- com.nxp.nfc.jar \
+ com.nxp.nfc \
Tag \
android.hardware.nfc@1.0-impl \
nfc_nci.$(NXP_NFC_PLATFORM) \
@@ -45,14 +45,11 @@ PRODUCT_PACKAGES += \
PRODUCT_PACKAGES += \
android.hardware.nfc@1.2-service
-ifeq ($(ENABLE_TREBLE), true)
+#ifeq ($(ENABLE_TREBLE), true)
PRODUCT_PACKAGES += \
vendor.nxp.nxpnfc@1.0-impl \
vendor.nxp.nxpnfc@1.0-service
-endif
+#endif
PRODUCT_PROPERTY_OVERRIDES += \
ro.hardware.nfc_nci=$(NXP_NFC_PLATFORM)
-
-BOARD_SEPOLICY_DIRS += vendor/$(NXP_VENDOR_DIR)/nfc/sepolicy \
- vendor/$(NXP_VENDOR_DIR)/nfc/sepolicy/nfc
Is the communication between MTK8788 and PN7169 working normally? does the kernel driver come from
$ git clone https://github.com/NXPNFCLinux/nxpnfc.git drivers/nfc ?
Please also check the connections, SDA, SCL, GND, VBAT, VANT, IRQ, VEN