完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
开发者您好,
我们目前正在开发一种产品,我们目前正在将 STM32 控制器与 NXP 的 PN7161 NFC 读取器连接起来,以将数据写入/读取 ST25DV04KC 动态标签 (IS015693)。 我们参考了最新固件“ SW6705 ”中的示例代码“nfc_example_RW.c”作为开发我们固件的参考。 以下是我们用于 NFC 示例的 NFC 设置: 我刚刚将 NXP_TVDD_CONF 更改为1,因为 VDD 为 3.3V。 /***** NFC dedicated setting ****************************************/ /* Following definitions specifies which settings will apply when NxpNci_ConfigureSettings() * API is called from the application */ #define NXP_CORE_CONF 1 #define NXP_CORE_STANDBY 1 #define NXP_CORE_CONF_EXTN 1 #define NXP_CLK_CONF 1 // 1=Xtal, 2=PLL #define NXP_TVDD_CONF 1 // 1=3.3V, 2=4.75V #define NXP_RF_CONF 1 uint8_t NxpNci_SettingCurrentTS[32] = __TIMESTAMP__; #if NXP_CORE_CONF /* NCI standard dedicated settings * Refer to NFC Forum NCI standard for more details */ uint8_t NxpNci_CORE_CONF[]={0x20, 0x02, 0x05, 0x01, /* CORE_SET_CONFIG_CMD */ 0x00, 0x02, 0xFE, 0x01 /* TOTAL_DURATION */ }; #endif #if NXP_CORE_CONF_EXTN /* NXP-NCI extension dedicated setting * Refer to NFC controller User Manual for more details */ uint8_t NxpNci_CORE_CONF_EXTN[]={0x20, 0x02, 0x05, 0x01, /* CORE_SET_CONFIG_CMD */ 0xA0, 0x40, 0x01, 0x00 /* TAG_DETECTOR_CFG */ }; #endif #if NXP_CORE_STANDBY /* NXP-NCI standby enable setting * Refer to NFC controller User Manual for more details */ uint8_t NxpNci_CORE_STANDBY[]={0x2F, 0x00, 0x01, 0x00}; /* last byte indicates enable/disable */ #endif #if NXP_CLK_CONF /* NXP-NCI CLOCK configuration * Refer to NFC controller Hardware Design Guide document for more details */ #if (NXP_CLK_CONF == 1) /* Xtal configuration */ uint8_t NxpNci_CLK_CONF[]={0x20, 0x02, 0x05, 0x01, /* CORE_SET_CONFIG_CMD */ 0xA0, 0x03, 0x01, 0x08 /* CLOCK_SEL_CFG */ }; #else /* PLL configuration */ uint8_t NxpNci_CLK_CONF[]={0x20, 0x02, 0x09, 0x02, /* CORE_SET_CONFIG_CMD */ 0xA0, 0x03, 0x01, 0x11, /* CLOCK_SEL_CFG */ 0xA0, 0x04, 0x01, 0x01 /* CLOCK_TO_CFG */ }; #endif #endif #if NXP_TVDD_CONF /* NXP-NCI TVDD configuration * Refer to NFC controller Hardware Design Guide document for more details */ #if (NXP_TVDD_CONF == 1) /* TXLDO output voltage set to 3.3V */ uint8_t NxpNci_TVDD_CONF[]={0x20, 0x02, 0x0F, 0x01, 0xA0, 0x0E, 0x0B, 0x11, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0xD0, 0x0C}; #else /* TXLDO output voltage set to 4.75V */ uint8_t NxpNci_TVDD_CONF[]={0x20, 0x02, 0x0F, 0x01, 0xA0, 0x0E, 0x0B, 0x11, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x40, 0x00, 0xD0, 0x0C}; #endif #endif #if NXP_RF_CONF /* NXP-NCI RF configuration * Refer to NFC controller Antenna Design and Tuning Guidelines document for more details */ /* Following configuration relates to performance optimization of OM27160 NFC Controller demo kit */ uint8_t NxpNci_RF_CONF[]={0x20, 0x02, 0x4C, 0x09, 0xA0, 0x0D, 0x03, 0x78, 0x0D, 0x02, 0xA0, 0x0D, 0x03, 0x78, 0x14, 0x02, 0xA0, 0x0D, 0x06, 0x4C, 0x44, 0x65, 0x09, 0x00, 0x00, 0xA0, 0x0D, 0x06, 0x4C, 0x2D, 0x05, 0x35, 0x1E, 0x01, 0xA0, 0x0D, 0x06, 0x82, 0x4A, 0x55, 0x07, 0x00, 0x07, 0xA0, 0x0D, 0x06, 0x44, 0x44, 0x03, 0x04, 0xC4, 0x00, 0xA0, 0x0D, 0x06, 0x46, 0x30, 0x50, 0x00, 0x18, 0x00, 0xA0, 0x0D, 0x06, 0x48, 0x30, 0x50, 0x00, 0x18, 0x00, 0xA0, 0x0D, 0x06, 0x4A, 0x30, 0x50, 0x00, 0x08, 0x00 }; #endif 问题: 我能够成功连接到 NXPNci 设备,配置其设置、模式 (NXPNCI_MODE_RW),还能够使用在轮询模式下选择为 TECH_PASSIVE_15693 的技术启动发现过程。 代码参考: /* Discovery loop configuration according to the targeted modes of operation */ unsigned char DiscoveryTechnologies[] = { MODE_POLL | TECH_PASSIVE_15693, }; /* Open connection to NXPNCI device */ if (NxpNci_Connect() == NFC_ERROR) { printf("Error: cannot connect to NXPNCI device\n"); return; } if (NxpNci_ConfigureSettings() == NFC_ERROR) { printf("Error: cannot configure NXPNCI settings\n"); return; } if (NxpNci_ConfigureMode(NXPNCI_MODE_RW) == NFC_ERROR) { printf("Error: cannot configure NXPNCI\n"); return; } /* Start Discovery */ if (NxpNci_StartDiscovery(DiscoveryTechnologies,sizeof(DiscoveryTechnologies)) != NFC_SUCCESS) { printf("Error: cannot start discovery\n"); return; } 但是当我将 ST25DV04KC 标签带到阅读器 RF 场附近时,发现过程无法发现标签。我们也尝试过使用其他被动标签,但仍然无法获得任何发现通知。 在NxpNci_WaitForDiscoveryNotification中,我们卡在了以下代码片段中,我们收到的响应是 0x61 0x23 0x00 ,但它要求第一个第二字节为0x03。 do { if(NxpNci_WaitForReception(Answer, sizeof(Answer), &AnswerSize, TIMEOUT_INFINITE) == NXPNCI_ERROR) return NXPNCI_ERROR; }while ((Answer[0] != 0x61) || ((Answer[1] != 0x05) && (Answer[1] != 0x03))); 下面我给出了 NCI 调试日志以供参考: [18:03:28:032] PN7160 interfacing code [18:03:28:290] Scanning I2C bus: [18:03:28:340] ---------------------------------------0x28-----------------------------------------------------------------------------------0x7C--- [18:03:30:659] NCI >> 20 00 01 01 [18:03:30:712] NCI << 40 00 01 00 [18:03:30:719] NCI << 60 00 09 02 01 20 04 04 71 12 50 05 [18:03:30:721] Firmware Version: 12.50.5 [18:03:30:734] NCI >> 20 01 02 00 00 [18:03:30:753] NCI << 40 01 1e 00 1a 7e 06 03 01 d0 02 ff ff 01 ff 00 08 00 00 01 00 02 00 03 00 80 00 82 00 83 ... [18:03:31:814] NCI >> 2f 00 01 00 [18:03:31:827] NCI << 4f 00 01 00 [18:03:31:841] NCI >> 20 02 05 01 00 02 fe 01 [18:03:31:856] NCI << 40 02 02 00 00 [18:03:31:870] NCI >> 20 03 03 01 a0 14 [18:03:31:890] NCI << 40 03 25 00 01 a0 14 20 57 65 64 20 41 70 72 20 32 36 20 31 37 3a 31 35 3a 35 39 20 32 30 ... [18:03:31:910] NCI >> 20 02 05 01 a0 40 01 00 [18:03:31:925] NCI << 40 02 02 00 00 [18:03:31:939] NCI >> 20 02 05 01 a0 03 01 08 [18:03:31:954] NCI << 40 02 02 00 00 [18:03:31:970] NCI >> 20 02 0f 01 a0 0e 0b 11 01 01 01 00 00 00 10 00 d0 0c [18:03:31:987] NCI << 40 02 02 00 00 [18:03:32:009] NCI >> 20 02 4c 09 a0 0d 03 78 0d 02 a0 0d 03 78 14 02 a0 0d 06 4c 44 65 09 00 00 a0 0d 06 4c 2d ... [18:03:32:030] NCI << 40 02 02 00 00 [18:03:32:052] NCI >> 20 02 24 01 a0 14 20 57 65 64 20 41 70 72 20 32 36 20 31 37 3a 31 35 3a 35 39 20 32 30 32 ... [18:03:32:082] NCI << 40 02 02 00 00 [18:03:32:082] NCI >> 20 00 01 00 [18:03:32:105] NCI << 40 00 01 00 [18:03:32:105] NCI << 60 00 09 02 00 20 04 04 71 12 50 05 [18:03:32:114] NCI >> 20 01 02 00 00 [18:03:32:132] NCI << 40 01 1e 00 1a 7e 06 03 01 d0 02 ff ff 01 ff 00 08 00 00 01 00 02 00 03 00 80 00 82 00 83 ... [18:03:33:282] NCI >> 2f 02 00 [18:03:33:295] NCI << 4f 02 05 00 00 01 aa dd [18:03:33:312] NCI >> 21 00 10 05 01 01 01 02 01 01 03 01 01 04 01 02 80 01 80 [18:03:33:330] NCI << 41 00 01 00 [18:03:34:595] NCI >> 21 03 03 01 06 01 [18:03:34:609] NCI << 41 03 01 00 [18:03:36:797] [18:03:36:808] WAITING FOR DEVICE DISCOVERY [18:03:37:296] NCI << 61 23 00 [18:03:37:306] NCI << 61 23 00 [18:03:37:306] NCI << 61 23 00 [18:03:37:306] NCI << 61 23 00 [18:03:37:306] NCI << 61 23 00 [18:03:37:322] NCI << 61 23 00 那么谁能帮我解决这个无法在 RW 模式下发现基于 ISO15693 的 NFC 标签的问题。 |
|
相关推荐
|
|
只有小组成员才能发言,加入小组>>
1906个成员聚集在这个小组
加入小组我的项目我做主,使用GN+Ninja来完成构建系统(VSCode开发RT106X)
36358 浏览 0 评论
NXP IMX8应用处理器快速入门必备:技巧、使用、设计指南
4395 浏览 0 评论
6050 浏览 1 评论
6763 浏览 0 评论
NXP i.MX6UL开发板(linux系统烧录+规格+硬件+模块移植)使用手册
4212 浏览 0 评论
619浏览 2评论
求助,S32G上Core M启动后如何让Core A在Flash指定位置加载uboot?
614浏览 2评论
ESP32-WROVER-IE + LAN8720以太网,GPIO0电压只有1.6v,无法正常进入spi flash boot模式如何解决?
606浏览 2评论
求分享适用于PN7160 Android的NFC工厂测试应用程序
694浏览 2评论
796浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 07:26 , Processed in 1.046511 second(s), Total 77, Slave 60 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号