Hi,
# erase NDEF messgae length
wait("erase NDEF message length")
data = [0x03,0x00,0xD6,0x00,0x00,0x02,0x00,0x00]
Did you send this command to write an Empty NDEF?
The recommended empty NDEF is 0x00 0x03 0xD0 0x00 0x00.
In your dump, I see the bytes 0x03 0x00 for the length and I’m wondering if you may have done an error with the endianess: NFC Forum specification uses the Big Endian standard so the first byte is the MSB. If the length is “3 bytes�? you should write 0x00 0x03.
That’s a good thing that you do the NDEF programming in 3 steps. This is indeed what should be done. I’m sharing with you the Android log showing what is written in the tag when saving the URI “abc.com�?:
- First we have a command to select the NDEF File (File Id = 0x0001):
2020-07-15 14:06:26.262 10839-10883/com.st.st25nfc.dbg D/Type4Command: ==> Send SelectFile 0x0001 command: 00 a4 00 0c 02 00 01
2020-07-15 14:06:26.268 10839-10883/com.st.st25nfc.dbg D/Type4Command: Response: 90 00
- Then we write 0x00 0x00 in the NDEF Length:
2020-07-15 14:06:26.268 10839-10883/com.st.st25nfc.dbg D/Type4Command: ==> Send updateBinary command: 00 d6 00 00 02 00 00
2020-07-15 14:06:26.277 10839-10883/com.st.st25nfc.dbg D/Type4Command: Response: 90 00
- Then we write the NDEF message:
2020-07-15 14:06:26.278 10839-10883/com.st.st25nfc.dbg D/Type4Command: ==> Send updateBinary command: 00 d6 00 02 0c d1 01 08 55 01 61 62 63 2e 63 6f 6d
2020-07-15 14:06:26.289 10839-10883/com.st.st25nfc.dbg D/Type4Command: Response: 90 00
NB: We write from the offset 0x02 so, at this stage the length is still 0x00 0x00
- Then we write the correct NDEF length:
2020-07-15 14:06:26.290 10839-10883/com.st.st25nfc.dbg D/Type4Command: ==> Send updateBinary command: 00 d6 00 00 02 00 0c
2020-07-15 14:06:26.299 10839-10883/com.st.st25nfc.dbg D/Type4Command: Response: 90 00
Here is what we get in the memory at the end: 00 0c d1 01 08 55 01 61 62 63 2e 63 6f 6d
I think that you can do the same from I2C.
Concerning the dump shown on the last picture (the one starting with 0xD1), I have noticed that you miss the 2 bytes indicating the NDEF length.
Best regards