Topic: Mifare tag with NDEF data

Hi,

I want to write ndef data on a mifare tag. I think I need to format the mifare tag first to get this working. I've already have read the sticky thread about this topic. Unfortunatly all links are unreachable.
I have downloaded a ndef mifare dump file but I cannot write this dump file to my tag. I always get a message that nfc-mfclassic is unable to read textrecord_hello_world.ndef. Why?

Is there any other possibility to format a mifare tag to work with ndef messages?

Re: Mifare tag with NDEF data

xyz__ wrote:

I've already have read the sticky thread about this topic. Unfortunatly all links are unreachable.

Yes, you're right all datasheet links from NXP are dead and even using NXP's search engine, no way to find the document.

xyz__ wrote:

I have downloaded a ndef mifare dump file but I cannot write this dump file to my tag. I always get a message that nfc-mfclassic is unable to read textrecord_hello_world.ndef. Why?

I have to test but there is maybe a bug here :-)

xyz__ wrote:

Is there any other possibility to format a mifare tag to work with ndef messages?

Yes, a greatly easier way: use libfreefare's example named mifare-classic-write-ndef, and the job should be done.

Romuald Conty

Re: Mifare tag with NDEF data

Hi,
I've used the mifare-classic-write-ndef but it looks like only Sector 1 is ready for NDEF:

S0|B0 Key: FFFFFFFFFFFF [Manu ] [CE4E8CE9E58804004885149061800311]
S0|B1 Key: FFFFFFFFFFFF [Data ] [DB0003E1000000000000000000000000]
S0|B2 Key: FFFFFFFFFFFF [Data ] [00000000000000000000000000000000]
S0|B3 Key: FFFFFFFFFFFF [Trail] [0000000000007F078840000000000000]
Cannot read sector: 1 with key FFFFFFFFFFFF
S1|B0 Key: D3F7D3F7D3F7 [Data ] [0321D1021C53709101095402656E4C69]
S1|B1 Key: D3F7D3F7D3F7 [Data ] [626E666351010B55036C69626E66632E]
S1|B2 Key: D3F7D3F7D3F7 [Data ] [6F7267FE000000000000000000000000]
S1|B3 Key: D3F7D3F7D3F7 [Trail] [0000000000007F078840000000000000]
S2|B0 Key: FFFFFFFFFFFF [Data ] [00000000000000000000000000000000]
S2|B1 Key: FFFFFFFFFFFF [Data ] [00000000000000000000000000000000]
S2|B2 Key: FFFFFFFFFFFF [Data ] [00000000000000000000000000000000]
S2|B3 Key: FFFFFFFFFFFF [Trail] [000000000000FF078069FFFFFFFFFFFF]
....

All other sectors are still using key FFF... and that is the standard mifare key or not?

Re: Mifare tag with NDEF data

xyz__ wrote:

Hi,
I've used the mifare-classic-write-ndef but it looks like only Sector 1 is ready for NDEF:
....
All other sectors are still using key FFF... and that is the standard mifare key or not?

I don't understand what you mean...
Your dump seems fine to me!

What is exactly the problem you have ?

Romuald Conty

Re: Mifare tag with NDEF data

Is there any possiblity to get all sectors formatted (not only 0 + 1) for ndef?

Re: Mifare tag with NDEF data

xyz__ wrote:

Is there any possiblity to get all sectors formatted (not only 0 + 1) for ndef?

It seems you do not understand how NDEF message on Mifare Classic is stored:
- Sector 0 is used by MAD (Mifare Application Directory) which is a kind of allocation table. It maps applications (in the mean of MAD) to sectors.
- A special allocation is made for NDEF when Mifare Classic used as NFC Forum Enabled Tag
- Sectors are allocated depending on NDEF Message size

Note: Sector 0 should be readed with a special key A and NDEF sectors should be readable using another special key A (see datasheets for more details). Key B could be kept secret but using mifare-classic-write-ndef example from libfreefare, all sectors are writables using key B with the same value of key A reading (see source code if more details are needed).

Romuald Conty

Re: Mifare tag with NDEF data

Hi,

I have just started playing around with NFC and wondered if you could help me with libfreefare?

I have an ACR122 and a selection of Ultralight and NTAG203 tags. I installed libnfc and am able to successfully execute nfc_list, so my setup appears to be ok. I installed libfreefare and have tried to use mifare-classic-write -i with some mfd files from here: http://code.google.com/p/nfc-tools/sour … unk/dumps.

The only output I get when I write is: NDEF file is 33995 bytes long. If I then remove the tag and reintroduce it to the reader and run mifare-classic-read -o and supply a filename all I get is a blank file.

Is there anything obvious I'm doing wrong?

Thanks for any help you can offer.