We have designed a board based on TI RF430FRL152HEVM evaluation module with NFC capability. When an Android phone comes near the the antenna of the board, the NFC allows the processor to boot up and to begin reading the data. It puts the data it reads into memory.
The phone must then grab this data out of the device using NFC (or rather ISO 15693).
The only way we know how to do this for the moment is to write it into the standard NFC memory blocks.
We downloaded an Android App called NFC TagInfo and this lets us scan our sensor and collect all the data in the sensor memory, i.e. all the blocks.
We are writing it into what the chip manufacturer says is the NDEF message area in FRAM. I have written a reader/writer NFC app for another project, that works well, but it refuses to read the data here, although NFC TagInfo does read the data.
We assumed that the TI chip had been NDEF formatted, but all the documentation we found on how to do this is very unclear. So we guess it hasn't been.
Could somebody explain how to properly prepare the memory contents so that an NDEF message can be read by the phone?
Additional information
We write data into the FRAM starting from block 0 onwards and have tried to mimic the data one would see in a typical tag containing a very simple NDEF message. For example we stored the message "ABCD" and using NFC TagInfo you see this in the first few blocks:
04 5c d8 08 4a 62 3e 80 96 48 00 00 e1 10 12 00 01 03 a0 0c 34 03 21 d1 01 1d 54 02 65 6e 41 42 43 44 20 20 ...
Where 41 42 43 44
is "ABCD" in UTF-8.
We took this data (NDEF format + headers) from another tag (read using NFC TagInfo) and copied this data into the FRAM blocks of our tag chip. We stopped at the end of the NDEF message and the rest of the FRAM is 0x00
or 0xff
.
Obviously the tag that we copied the data from (NXP) and our tag chip (TI) are from different manufacturers so some data in the first few blocks is not valid for our TI chip but assumed that Android shouldn’t care.
However, when we read our TI tag with NFC TagInfo it can read the raw data blocks but it does not recognize the tag as an NDEF formatted tag.
Is it that the NDEF formatting we copied from the other tag is not valid for our tag because we are not using the same tag memory sizes, etc?
If one simply writes the correct bytes in the correct blocks then can anything be picked up as NDEF, after all, at the low level what is the difference?
If this is the case what would be the most sensible test case of bytes to use in which blocks, is there a better way to test the concept?
Does block locking make any difference? As we can see some blocks are locked in a real tag.
Why does NFC TagInfo see blocks sometimes and then pages for when NDEF is detected? Are blocks and pages the same?
Failing all else, how can we codify in Android simple block reading, in the same way that the NFC TagInfo performs its hex-dump? If we can do that then NDEF is not really necessary.
Additional information 2
I have modified the firmware such that the FRAM, from block 0 onwards contains the data you have mentioned:
E1 40 F2 09 03 0B D1 01 07 54 02 65 6E 41 42 43 44 FE 00 00 00 00 00 00
However I cannot seem to put the TI chip in 8 byte block mode. There does not appear to be a control register related to this.
From my low level point of view writing blocks in 4 or 8 bytes is not an issue, that is, I byte wise write the above data sequentially in FRAM memory.
When I run NFC TagInfo it does two things but does not detect an NDEF message:
- It does detect the UID correctly, and the fact the RF Tech is Type 5 (ISO 15693 / Vicinity)
- It also does read the blocks correctly and on selecting Data HEX display I see precisely the above data in the blocks starting from block 0.
I have consulted the NFC Tag Type 5 Specification which I got from http://open-nfc.org/documents/STS_NFC_0707-001%20NFC%20Tag%20Type%205%20Specification.pdf
So I tried to write more data into the TAG from block 0 to try and emulate the SERIAL NUMBER, CONFIGURATION, Application area issuer blocks. And then I placed the NDEF message ABCD after the sections:
01 02 03 04 05 06 07 08 //serial number 00 00 00 80 00 10 00 00 //configuration ...
I used NFC TagInfo but I could not detect an NDEF message either. However, using the Data Hex display I could verify the data was correctly read out as above.
So my questions are:
- Is it relevant whether 4 or 8 byte block mode are configured and where most likely is this mode defined? Can I work in 4 byte block mode all the same?
- Is the TAG 5 serial number relevant? Doesn't seem to affect NDEF checking according to the spec.
- Is the TAG 5 application area issuer relevant? Doesn't seem to be relevant to NDEF verification.
- Is the NDEF message I have placed in the correct area?
- For 16 bit values is it high byte low byte or low byte high byte ordering?
- Any ideas what's going wrong?
Additional information 3
It turned out that TI needed to provide a patch in order to get NDEF to work with that chip (FRL152H). Basically the chip is designed to support high level control of sensor functions via NFC, using an internal firmware application. This application needed to be disabled and some settings changed.
The following memory configuration turned out to work:
Block 0: E1 40 79 00 Block 1: 03 0B D1 01 Block 2: 07 54 02 65 Block 3: 6e 41 42 43 Block 4: 44 FE 00 00