Using PN7120 Linux Software Stack linux_libnfc-nci for block level access Mifare Classic and UL tags

cancel
Showing results for 
Search instead for 
Did you mean: 

Using PN7120 Linux Software Stack linux_libnfc-nci for block level access Mifare Classic and UL tags

1,729 Views
toivokiisk
Contributor I

Dear all

I am using OM5577/PN7120S on Raspberry Pi.

It is working great with Raspberry Pi and I can read ID and NDEF info from tag.

But how to authenticate, read and write sectors and blocks Mifare Classic and UL tags?

Hints that this is possible can be found in demo application function "WaitDeviceArrival"

...

//Cmd Mifare Auth Key A : 0x60U

MifareAuthCmd[12] = {0x60U, block, 0x02, 0x02, 0x02, 0x02, key[0] , key[1] , key[2] , key[3] , key[4] , key[5] };

...

//Cmd Mifare Read 16 : 0x30U

MifareReadCmd[2] = {0x30U,  block};

...

These commands are sent using function "nfcTag_transceive"

Is there any documentation describing how to do tags block level access using libnfc-nci?

Thank you.

Tags (2)
0 Kudos
2 Replies

608 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Toivo Kiisk:

All commands to MIFARE cards are sent through the PN7120 using NCI data packets. That code you found indeed shows the authentication (command 0x60) and read (command 0x30).

The PN7120 also includes a proprietary RF interface called TAG-CMD which is not defined by NFC Forum NCI specification.

This interface simplifies the access to MIFARE Classic cards using also data packets but with a different payload scheme. Details in the PN7120 user manual:

http://cache.nxp.com/documents/application_note/UM10819.pdf

The commands for MIFARE Classic and MIFARE Ultralight are described in the corresponding datasheets.

Regards!

Jorge Gonzalez

608 Views
toivokiisk
Contributor I

Thanks

I already managed to get demo application work with cards I have.

I now hope that this dokument helps also understand what actually happens.

Toivo

0 Kudos