nfcndef

NTAG213 NDEF records offset Locking / Protection


I tried to write a NDEF text message to an NFC NTAG 213 chip. I use the nfcpy library for that. The problem now is that I want to lock a specific NDEF text record on the chip and want to modify or add different records later on.

Generally you can only lock the whole chip with the nfcpy library. I consider to only lock the pages which are written for the records I want to lock. When I only lock the pages where the data is stored I can not write any other NDEF record to the chip.

Is there a way to create an offset or is there a specific padding mechanism for that? Or is it only possible to have several NDEF records in one order? So the only thing I want to achieve is have multiple records on the chip and one record should be read only.


Solution

  • If you look at the datasheet you can configure password protection on write operations, this might achieve what you want.

    This is different to locking the chip at the Ndef level as that is a one way operation for the whole chip.

    Thus with password on write operations only then the chip is effectively locked Unless you know the password where you can then re-write the whole Ndef message (The standard Ndef system only allows you to write whole Ndef messages, thus to add a ndef record all records have to be re-written)

    While you can set the start block address of the password protection you cannot leave the first part open for writing while having the second part password protected because the whole ndef message re-writing (and because the first record size might change and the start address would have to change as well.

    Detail example of setting a password at https://stackoverflow.com/a/22723250/2373819 (you will just have to adjust the memory locations used for your size of Tag)