完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,
我在通过i2c向M24SR(带8KB EEPROM)写入NDEF消息时遇到问题。 我可以通过官方M24SR Android应用程序正确编写NDEF文本消息。 我能够通过i2c正确读取NDEF文件。 但是,当我尝试通过i2c将''hello world''写入NDEF文件时,M24SR Android应用会读取空的NDEF。 这是我尝试过的i2c序列: (杀RF) AC 52 (选择NFC) AC 02 00 A4 00 0C 02 E1 03 D2 AF (读取5个回复字节) 02 90 00 F1 09 (选择CC) AC 03 00 A4 00 0C 02 E1 03 D2 AF (读取5个回复字节) 03 90 00 2D 53 (读取CC长度) AC 02 00 B0 00 00 02 6B 7D (7个回复字节读取) 02 00 0F 90 00 44 45 (阅读CC文件) AC 03 00 B0 00 00 0F A5 A2 (读取20个读取字节) 03 00 0F 20 00 F6 00 F6 00 F6 04 06 00 01 20 00 00 00 90 00 A9 F3 (选择NDEF文件) AC 02 00 A4 00 0C 02 00 01 3E FD (读取5个回复字节) 02 90 00 F1 09 (擦除NDEF长度) AC 03 00 D6 00 00 02 00 00 6B 37 (读取5个回复字节) 03 90 00 2D 53 (使用''hello world''更新二进制NDEF) AC 02 00 D6 00 02 0B 68 65 6C 6C 6F 20 77 6F 72 6C 64 2F FC (读取5个回复字节) 02 90 00 F1 09 (更新NDEF的二进制文件,长度为''hello world''= 11 = 0x0B) AC 03 00 D6 00 00 02 00 0B (读取5个回复字节) 03 90 00 2D 53 (取消选择) AC C2 E0 B4 (3个回复字节读取) C2 E0 B4 再次,在此序列之后,当通过i2c读取NDEF时,找到“hello world”,但Android应用程序看到空的NDEF。我尝试在通过i2c阅读Android编写的NDEF时附加相同的“标题”,但是回复没有正确的CRC。 有谁可以帮助澄清实施并指出我正确的方向? 提前致谢, 乔恩 #android #ndef#m24sr 以上来自于谷歌翻译 以下为原文 Hello, I'm having trouble writing an NDEF message to the M24SR (with 8KB EEPROM) via i2c. I am able to correctly write an NDEF Text Message via the official M24SR Android app. I am able to correctly read the NDEF File via i2c. However, when I try to write ''hello world'' via i2c to the NDEF file, the M24SR Android app reads an empty NDEF. Here is the i2c sequence of what I've tried: (kill RF) AC 52 (select NFC) AC 02 00 A4 00 0C 02 E1 03 D2 AF (5 reply bytes read) 02 90 00 F1 09 (select CC) AC 03 00 A4 00 0C 02 E1 03 D2 AF (5 reply bytes read) 03 90 00 2D 53 (read CC length) AC 02 00 B0 00 00 02 6B 7D (7 reply bytes read) 02 00 0F 90 00 44 45 (read CC file) AC 03 00 B0 00 00 0F A5 A2 (20 read bytes read) 03 00 0F 20 00 F6 00 F6 00 F6 04 06 00 01 20 00 00 00 90 00 A9 F3 (select NDEF file) AC 02 00 A4 00 0C 02 00 01 3E FD (5 reply bytes read) 02 90 00 F1 09 (erase NDEF length) AC 03 00 D6 00 00 02 00 00 6B 37 (5 reply bytes read) 03 90 00 2D 53 (update binary NDEF with ''hello world'') AC 02 00 D6 00 02 0B 68 65 6C 6C 6F 20 77 6F 72 6C 64 2F FC (5 reply bytes read) 02 90 00 F1 09 (update binary of NDEF with length of ''hello world'' = 11 = 0x0B) AC 03 00 D6 00 00 02 00 0B (5 reply bytes read) 03 90 00 2D 53 (deselect) AC C2 E0 B4 (3 reply bytes read) C2 E0 B4 Again, after this sequence, when the NDEF is read via i2c, ''hello world'' is found, but the Android app sees an empty NDEF. I've tried appending the same ''header'' found when reading the Android-written NDEF via i2c, however the replies do not have a correct CRC. Can anyone please help clarify the implementation and point me in the right direction? Thanks in advance, Jon #android #ndef #m24sr |
|
相关推荐
4个回答
|
|
嗨乔恩,
关于您的问题,这与NFC数据交换格式(NDEF)和NFC论坛文本记录类型规范(NFCForum-TS-RTD_Text_1.0)的格式相关联。 他们的格式在NFC论坛网站上有解释。 如果未正确写入NDEF消息,则Android系统无法确定哪种NDEF消息存储在内存中。 的确如此 (使用''hello world''更新二进制NDEF) AC 02 00 D6 00 02 0B 68 6C 65 6C 6F 20 77 6F 72 6C 64 2F FC NDEF标题: 记录布局: 第一个字节:(0xD1) MB = 1 ME = 1b CF = 0b SR = 1b IL = 0b不存在 TNF = 001b(众所周知的类型) 第二字节: 类型长度= 0x01 第三字节: 有效载荷长度:0x0E - 14个字节 第四字节: 类型= 0x54:“T” 有效载荷:02 65 6E 68 65 6C 6C 6F 20 77 6F 72 6C 64 你好,世界 根据NFCForum TS RTD文本文档(先前详述的有效负载)的有效负载: 1字节(0x02):状态字节0x02(UTF-8; b6:RFU; IANA代码长度:2字节) 2字节(IANA代码):0x65 0x6E:“â” 在Update Binary命令的结论中,要写入的Payload是: AC 02 00 D6 00 02 12 D1 01 0E 54 02 65 6E 68 65 6C 6C 6F 20 77 6F 72 6C 64 CRC1 CRC2 然后更新二进制大小: NDEF长度必须设置为18个字节 AC 03 00 D6 00 00 02 00 12 我希望这能帮到你, 最好的祝福, 祝你今天愉快, ST NFC / RFID动态标签支持 以上来自于谷歌翻译 以下为原文 Hi Jon, Concerning your issue, this is linked to the format of the NFC Data Exchange Format (NDEF) and the NFC forum Text Record type specification (NFCForum-TS-RTD_Text_1.0). Their format are explained on the NFC Forum web site. If the NDEF message is not correctly written, the Android system can’t determine which kind of NDEF message is stored in the memory. Indeed on (update binary NDEF with ''hello world'') AC 02 00 D6 00 02 0B 68 6C 65 6C 6F 20 77 6F 72 6C 64 2F FC NDEF header: Record layout : First Byte: (0xD1) MB = 1 ME = 1b CF = 0b SR = 1b IL = 0b not present TNF = 001b (wellknown type) Second Byte: Type length = 0x01 Third Byte: Payload Length : 0x0E - 14 bytes Fourth Byte: Type = 0x54 : “Tâ€� Payload : 02 65 6E 68 65 6C 6C 6F 20 77 6F 72 6C 64 h e l l o w o r l d Payload according to NFCForum TS RTD text document (the payload detailed previously) : 1 Byte (0x02) : Status byte 0x02 ( UTF-8;b6:RFU; Length of IANA Code : 2 bytes) 2 bytes (IANA Code) : 0x65 0x6E : “enâ€� In conclusion on Update Binary command the Payload to write is : AC 02 00 D6 00 02 12 D1 01 0E 54 02 65 6E 68 65 6C 6C 6F 20 77 6F 72 6C 64 CRC1 CRC2 And then update binary size : NDEF Length must be set to 18 bytes AC 03 00 D6 00 00 02 00 12 I hope this is helping you, Best Regards, Have a nice day, ST NFC/RFID Dynamic tag support |
|
|
|
你好ST支持,
谢谢您的回复。 我终于有时间尝试你的建议,但我仍然无法让Android应用程序正确读取i2c写的NDEF消息。 我暗示添加了NDEF标题。原始消息'Abc '是通过Android应用程序编写的。我正在尝试更新消息以包含'hello world '通过i2c 以下是我通过i2c发送/接收的命令/回复。 下午3:08:34 杀死RF [S _] [W _] [02] [AC] [52] [P_] 下午3:08:34 selectNFC [S _] [W _] [11] [AC] [02] [00] [A4] [04] [00] [07] [D2] [76] [00] [00] [85] [01] [01 ] [00] [35] [C0] [P_] 下午3:08:35 5个回复字节读取 [S _] [02] [90] [00] [F1] [09] [P_] 下午3:08:35 选择cc [S _] [W _] [0B] [AC] [03] [00] [A4] [00] [0℃] [02] [E1] [03] [D2] [AF] [P_] 下午3:08:35 5个回复字节读取 [S _] [03] [90] [00] [2D] [53] [P_] 下午3:08:35 读cc长度 [S _] [W _] [09] [AC] [02] [00] [B0] [00] [00] [02] [6B] [7D] [P_] 下午3:08:35 7个回复字节读取 [S _] [02] [00] [0F] [90] [00] [44] [45] [P_] 下午3:09:58 读取cc文件 [S _] [W _] [09] [AC] [03] [00] [B0] [00] [00] [0F] [A5] [A2] [P_] 下午3:10:03 读取20个回复字节 [S _] [03] [00] [0F] [20] [00] [F6] [00] [F6] [04] [06] [00] [01] [20] [00] [00] [00 ] [90] [00] [A9] [F3] [P_] 下午3:10:04 选择NDEF [S _] [W _] [0B] [AC] [02] [00] [A4] [00] [0℃] [02] [00] [01] [3E] [FD] [P_] 下午3:10:04 5个回复字节读取 [S _] [02] [90] [00] [F1] [09] [P_] 下午3:13:26 擦除NDEF长度 [S _] [W _] [0B] [AC] [03] [00] [D6] [00] [00] [02] [00] [00] [6B] [37] [P_] 下午3:13:37 5个回复字节读取 [S _] [03] [90] [00] [2D] [53] [P_] 下午3:13:56 使用'hello world'更新二进制文件 [S _] [W _] [1B] [AC] [02] [00] [D6] [00] [02] [12] [D1] [01] [0E] [54] [02] [65] [6E ] [68] [65] [6C] [6C] [6F] [20] [77] [6F] [72] [6C] [64] [EC] [5C] [P_] 下午3:15:17 更新ndef长度 [S _] [W _] [0B] [AC] [03] [00] [D6] [00] [00] [02] [00] [12] [F8] [04] [P_] 下午3:15:21 5个回复字节读取 [S _] [03] [90] [00] [2D] [53] [P_] 下午3:18:21 取消 [S _] [W _] [04] [AC] [C2] [E0] [B4] [P_] 下午3:18:22 读取3个回复字节 [S _] [C2] [E0] [B4] [P_] 文档声称应该为UpdateBinary回复读取5个字节,但CRC不匹配(但如果省略第5个字节则正确)。 发送ReadBinary过程的命令后,输出为 [S _] [02] [D1] [01] [06] [54] [02] [65] [6E] [41] [62] [63] [6C] [6F] [20] [77] [6F ] [72] [6C] [64] [90] [00] [03] [11] [P_] ASCII中的数据最终为 '阿布克洛世界 “ 不应该是这种情况,因为UpdateBinary命令的偏移量是02(消息的开头,超过为NDEF消息长度指定的字节)。 你能否谈谈这个问题? 再次感谢, 乔恩 以上来自于谷歌翻译 以下为原文 Hello ST support, Thank you for your reply. I finally had time to try your suggestion, however I am still unable to get the Android app to correctly read the NDEF message written by i2c. I added the NDEF header as hinted. The original message 'Abc ' was written via the Android app. I am trying to update the message to contain 'hello world ' via i2c Here are the commands/replies that I am sending/receiving via i2c. 3:08:34 PM kill RF [S_][W_][02][AC][52][P_] 3:08:34 PM selectNFC [S_][W_][11][AC][02][00][A4][04][00][07][D2][76][00][00][85][01][01][00][35][C0][P_] 3:08:35 PM 5 reply bytes read [S_][02][90][00][F1][09][P_] 3:08:35 PM select cc [S_][W_][0B][AC][03][00][A4][00][0C][02][E1][03][D2][AF][P_] 3:08:35 PM 5 reply bytes read [S_][03][90][00][2D][53][P_] 3:08:35 PM read cc length [S_][W_][09][AC][02][00][B0][00][00][02][6B][7D][P_] 3:08:35 PM 7 reply bytes read [S_][02][00][0F][90][00][44][45][P_] 3:09:58 PM read cc file [S_][W_][09][AC][03][00][B0][00][00][0F][A5][A2][P_] 3:10:03 PM 20 reply bytes read [S_][03][00][0F][20][00][F6][00][F6][04][06][00][01][20][00][00][00][90][00][A9][F3][P_] 3:10:04 PM select NDEF [S_][W_][0B][AC][02][00][A4][00][0C][02][00][01][3E][FD][P_] 3:10:04 PM 5 reply bytes read [S_][02][90][00][F1][09][P_] 3:13:26 PM erase NDEF length [S_][W_][0B][AC][03][00][D6][00][00][02][00][00][6B][37][P_] 3:13:37 PM 5 reply bytes read [S_][03][90][00][2D][53][P_] 3:13:56 PM update binary with 'hello world' [S_][W_][1B][AC][02][00][D6][00][02][12][D1][01][0E][54][02][65][6E][68][65][6C][6C][6F][20][77][6F][72][6C][64][EC][5C][P_] 3:15:17 PM update ndef length [S_][W_][0B][AC][03][00][D6][00][00][02][00][12][F8][04][P_] 3:15:21 PM 5 reply bytes read [S_][03][90][00][2D][53][P_] 3:18:21 PM deselect [S_][W_][04][AC][C2][E0][B4][P_] 3:18:22 PM 3 reply bytes read [S_][C2][E0][B4][P_] The documentation claims that 5 bytes should be read for the UpdateBinary reply, however the CRC does not match (but it is correct if the 5th byte is omitted). After the commands for the ReadBinary procedure are sent, the output is [S_][02][D1][01][06][54][02][65][6E][41][62][63][6C][6F][20][77][6F][72][6C][64][90][00][03][11][P_] The data in ASCII ends up as 'Abclo world ' which should not be the case since the offset for the UpdateBinary command is 02 (beginning of the message, past the bytes designated for the NDEF message length). Can you please shed some light on this issue? Thanks again, Jon |
|
|
|
嗨乔恩,
您的NDEF“文本”消息缺少NDEF标头。它应该如下。 D1010E5402656E68656C6C6F20776F726C64 您可以在www.nfcdynamictag.com上查看M24SRxx食谱 最好的祝福, 约翰 以上来自于谷歌翻译 以下为原文 Hi Jon, Your NDEF ''text'' message is missing the NDEF header. It should be as below. D1010E5402656E68656C6C6F20776F726C64 You might want to check out the M24SRxx cookbook at www.nfcdynamictag.com Best regards, John |
|
|
|
你好,
问题来自I2C序列中突出显示的行: 这个标签的asnwer并不那么奇怪:这是一个EXTENTION WINDOW请求。 当请求更新二进制文件并且处理此编程的时间高于预期时间时,标记发送延长时间...编译器尚未处理,直到读者将发回该延长时间请求的协议。 使用'hello world'更新二进制文件 [S _] [W _] [1B] [AC] [02] [00] [D6] [00] [02] [12] [D1] [01] [0E] [54] [02] [65] [6E ] [68] [65] [6C] [6C] [6F] [20] [77] [6F] [72] [6C] [64] [EC] [5C] [P_] 将花费超过10ms的时间,因此请求FWT。 好的过程应该是: 使用'hello world'更新二进制文件 [S _] [W _] [1B] [AC] [02] [00] [D6] [00] [02] [12] [D1] [01] [0E] [54] [02] [65] [6E ] [68] [65] [6C] [6C] [6F] [20] [77] [6F] [72] [6C] [64] [EC] [5C] [P_] 问候, 以上来自于谷歌翻译 以下为原文 Hello, the problem comes from the lines highlighted in your I2C sequence : This asnwer from the Tag is not so strange : this is a EXTENTION WINDOW request. When a Update binary is requested AND time to process this prog is higher than expected time, an extention time is sent by the tag ... prog is not yet processed until the reader will send back an agreement for this extention time request. update binary with 'hello world' [S_][W_][1B][AC][02][00][D6][00][02][12][D1][01][0E][54][02][65][6E][68][65][6C][6C][6F][20][77][6F][72][6C][64][EC][5C][P_] Will take more than 10ms time, so a FWT is requested. The good process should be : update binary with 'hello world' [S_][W_][1B][AC][02][00][D6][00][02][12][D1][01][0E][54][02][65][6E][68][65][6C][6C][6F][20][77][6F][72][6C][64][EC][5C][P_] Regards, |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2735 浏览 1 评论
3241 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1810 浏览 1 评论
3650 浏览 6 评论
6039 浏览 21 评论
1339浏览 4评论
201浏览 3评论
对H747I-DISCO写程序时将CN2的st-link复用为usart1,再次烧录时无法检测到stlink怎么解决?
353浏览 2评论
STM32G474RE芯片只是串口发个数据就发烫严重是怎么回事?
444浏览 2评论
STM32处理增量式编码器Z信号如何判断中断是正转的还是反向转的?
274浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-25 01:24 , Processed in 1.306061 second(s), Total 84, Slave 68 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号