When I run the mifareclassic_formatndef sketch on my card (without making any changes, so it's supposed to be writing the "adafruit.com" url), here's the output:
Code: Select all
Looking for PN532...
Found chip PN532
Firmware ver. 1.6
Place your Mifare Classic card on the reader to format with NDEF
and press any key to continue ...
Found 1 tags
ATQA: 0x4
SAK: 0x8
UID: 0x2 0xC2 0x32 0xAF
Found an ISO14443A card
UID Length: 4 bytes
UID Value: 0x02 0xC2 0x32 0xAF
Seems to be a Mifare Classic card (4 byte UID)
Trying to authenticate card 0x02 0xC2 0x32 0xAF
Using authentication KEY A: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
Trying to write 16 bytes to block 1
Trying to write 16 bytes to block 2
Trying to write 16 bytes to block 3
Card has been formatted for NDEF data using MAD1
Trying to authenticate card 0x02 0xC2 0x32 0xAF
Using authentication KEY A: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
Writing URI to sector 1 as an NDEF Message
Trying to write 16 bytes to block 4
Trying to write 16 bytes to block 5
Trying to write 16 bytes to block 6
Trying to write 16 bytes to block 7
NDEF URI Record written to sector 1
Code: Select all
Looking for PN532...
Found chip PN532
Firmware ver. 1.6
Waiting for an ISO14443A Card ...
Found 1 tags
ATQA: 0x4
SAK: 0x8
UID: 0x2 0xC2 0x32 0xAF
Found an ISO14443A card
UID Length: 4 bytes
UID Value: 0x02 0xC2 0x32 0xAF
Seems to be a Mifare Classic card (4 byte UID)
------------------------Sector 0-------------------------
Trying to authenticate card 0x02 0xC2 0x32 0xAF
Using authentication KEY A: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
Trying to read 16 bytes from block 0
Unexpected response
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80
Block 0 unable to read this block
Trying to read 16 bytes from block 1
Unexpected response
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80
Block 1 unable to read this block
Trying to read 16 bytes from block 2
Unexpected response
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80
Block 2 unable to read this block
Trying to read 16 bytes from block 3
Unexpected response
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80
Block 3 unable to read this block
------------------------Sector 1-------------------------
Trying to authenticate card 0x02 0xC2 0x32 0xAF
Using authentication KEY A: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
Trying to read 16 bytes from block 4
Unexpected response
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80
Block 4 unable to read this block
Trying to read 16 bytes from block 5
Unexpected response
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80
Block 5 unable to read this block
Trying to read 16 bytes from block 6
Unexpected response
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80
Block 6 unable to read this block
Trying to read 16 bytes from block 7
Unexpected response
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80
Block 7 unable to read this block
------------------------Sector 2-------------------------
Trying to authenticate card 0x02 0xC2 0x32 0xAF
Using authentication KEY A: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
Trying to read 16 bytes from block 8
Unexpected response
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80
Block 8 unable to read this block
Trying to read 16 bytes from block 9
Unexpected response
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80
Block 9 unable to read this block
Trying to read 16 bytes from block 10
Unexpected response
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80
Block 10 unable to read this block
Trying to read 16 bytes from block 11
Unexpected response
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80
Block 11 unable to read this block
------------------------Sector 3-------------------------
Trying to authenticate card 0x02 0xC2 0x32 0xAF
Using authentication KEY A: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
Trying to read 16 bytes from block 12
Unexpected response
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80
Block 12 unable to read this block
Trying to read 16 bytes from block 13
Unexpected response
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80
Block 13 unable to read this block
Trying to read 16 bytes from block 14
Unexpected response
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80
Block 14 unable to read this block
Trying to read 16 bytes from block 15
Unexpected response
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80
Block 15 unable to read this block
...
Since I haven't changed the examples at all, why doesn't this work? And what can I do to fix it? I'm stumped - but I'd love to get this working (since it's for a class project) so I appreciate your help.