Writing w/o NDEF Formatting - Adafruit PN532 NFC/RFID Shield
Moderators: adafruit_support_bill, adafruit

Writing w/o NDEF Formatting - Adafruit PN532 NFC/RFID Shield

by rockhound21 on Thu Jan 24, 2013 4:09 pm

Hello,

I bought the PN532 NFC/RFID Shield, with a couple of Mifare Classic RFID cards. I get the shield to read correctly with my Arduino Uno, but I would like to know:

1. Does the shield write to the card without NDEF Formatting? If so, how so?
2. Can one rewrite to a card that is NDEF Formatted?
3. Is NDEF formatting reversible?

Also, the I2C library for Arduino that is downloaded separately from Github only includes a sketch that writes using NDEF Formatting, is there another sketch that would allow people to write 'Mifare Classic-ally' to the card? Does writing to the card in this way allow for re-writing as well?

Thank you for your help!
rockhound21
 
Posts: 1
Joined: Thu Jan 24, 2013 3:46 pm

Re: Writing w/o NDEF Formatting - Adafruit PN532 NFC/RFID Shield

by adafruit_support_bill on Fri Jan 25, 2013 6:50 am

The hardware is capable, but there is very limited support in the library. See this thread for more details: viewtopic.php?f=31&t=33836&p=174406&hilit=ndef#p167479
User avatar
adafruit_support_bill
 
Posts: 31719
Joined: Sat Feb 07, 2009 10:11 am

Re: Writing w/o NDEF Formatting - Adafruit PN532 NFC/RFID Shield

by ktownsend on Sun Jan 27, 2013 8:42 pm

The library supports writing to plain Mifare cards as well. Have a look at the mifareclassic_memdump for example and you can substitute the read commands with the write function:

Code: Select all | TOGGLE FULL SIZE
uint8_t Adafruit_NFCShield_I2C::mifareclassic_WriteDataBlock (uint8_t blockNumber, uint8_t * data)


You first need to authenticate the block.

As for NDEF, use this with care since you need to change the authentication keys for NDEF support. You CAN still write to the blocks, but they keys will be different, and you should probably consider the format one way and keep separate NDEF and pure Mifare Classic cards for convenience sake.

Have a look here as well as the NDEF page just after this one: http://learn.adafruit.com/adafruit-pn53 ... nfc/mifare
User avatar
ktownsend
 
Posts: 362
Joined: Thu Nov 05, 2009 2:18 am