I've just installed on an old HP ML310 G5 box Fedora 25 Server edition from the current ISO. It boots with the installation kernel - 4.8.6-300. I see in dmesg the errors below, but still it boots.
[ 0.033000] smpboot: CPU0: Intel(R) Xeon(R) CPU 3065 # 2.33GHz (family: 0x6, model: 0xf, stepping: 0xb)
[ 0.033000] Performance Events: PEBS fmt0+, Core2 events, Broken BIOS detected, complain to your hardware vendor.
[ 0.033000] [Firmware Bug]: the BIOS has corrupted hw-PMU resources (MSR 186 is 43003c)
[ 0.033000] Intel PMU driver.
...
[ 0.678420] ACPI: Thermal Zone [THM0] (8 C)
[ 0.678473] ERST: Failed to get Error Log Address Range.
[ 0.678578] GHES: APEI firmware first mode is enabled by WHEA _OSC.
...
[ 7.356291] iTCO_wdt: Found a ICH9R TCO device (Version=2, TCOBASE=0x0960)
[ 7.356313] watchdog: iTCO_wdt: cannot register miscdev on minor=130 (err=-16).
[ 7.356453] watchdog: iTCO_wdt: a legacy watchdog module is probably present.
[ 7.356823] iTCO_wdt: initialized. heartbeat=30 sec (nowayout=0)
...
[ 12.411314] audit: type=1305 audit(1492254455.147:78): audit_pid=800 old=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:auditd_t:s0 res=1
[ 12.804386] Raw EDID:
[ 12.804433] 00 00 00 00 00 00 3f ff ff ff ff ff ff ff ff ff
[ 12.804519] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[ 12.804613] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[ 12.804718] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[ 12.804803] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[ 12.804888] ff ff ff 80 00 00 00 00 00 00 00 00 00 00 00 00
[ 12.804973] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 12.805065] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 12.833820] EDID block is all zeroes
[ 12.862313] EDID block is all zeroes
[ 12.890773] Raw EDID:
[ 12.890817] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 12.890902] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 12.890987] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 12.891081] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 12.891166] 00 00 00 00 00 7f ff ff ff ff ff ff ff ff ff ff
[ 12.891263] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[ 12.891364] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[ 12.891449] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[ 12.891538] radeon 0000:01:02.0: VGA-1: EDID block 0 invalid.
after I did dnf makecache; dnf update and switched from kernel - 4.8.6-300 to 4.10.9-200 the server fails to boot... I can't get logs, because I can't login get to an interactive prompt.. the only messages I see on the screen are:
[Firmware bug]: The BIOS has corrupted hw-PMU resources (MSR 186 is 43003c)
ACPI Error: Field [CDW3] at 96 exceeds Buffer [NULL] size 64 (bits) (20160930/dsopcode-236)
ACPI Error: Method parse/execution failed [\_SB._OSC] (Node ffffa38274baf50), AE_AML_BUFFER_LIMIT (20160930/psparse-543)
NMI watchdog: BUG: soft lockup - CPU#0 stuck for 23s! [swapper/01]
I found some information regarding the hw-PMU resources, but from what i understand from the HP & RHEL articles, this not the main problem. Also this is my feeling, since I can boot with this error and the 4.8 kernel... I still can't find any useful information regarding the ACPI Error and NMI Watchdog errors.
Any ideas how to fix this one? I hope I can workaround the problem with BIOS change or kernel parameter while booted with the 4.8 kernel...
From bugzilla
HP's \SB._OSC method violates the ACPI spec. \SB._OSC is documented
as taking an 8-byte argument, while the HP firmware is attempting to
interpret it as a 12-byte one. HP have ignored the spec for this
method and implemented their own as part of the Processor Clocking
Control specification. We can't work around this without risking
breaking spec-compliant machines. Nothing will actually be broken as a
result of this error.
Related
I have a MIFARE Classic 1k, I used a reader to read everything on the card and would like to encode any data I write to it in NDEF so it can be read by a phone. I can only manually write the bytes atm and don't really know where to go from here. (I removed the data i wrote and replaced it with zeroes because it was sensitive)
Tried using different software but it seems like im the only one who wants such a weird thing done, here is the dump of the card. I do know the 16 sectors are separated by the KeyA ACs and KeyB (...FFFFF078069FFF...) Each sector being four blocks long ending in the keys, and all sector zero is used for is manufacturer info and UID.
Block 0: 77 57 DF D7 28 08 04 00 62 63 64 65 66 67 68 69
Block 1: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 2: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 3: FF FF FF FF FF FF FF 07 80 69 FF FF FF FF FF FF
Block 4: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 5: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 6: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 7: FF FF FF FF FF FF FF 07 80 69 FF FF FF FF FF FF
Block 8: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 9: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 11: FF FF FF FF FF FF FF 07 80 69 FF FF FF FF FF FF
And so on until block 63...
I want to write to a mifare classic 4k, using the following APDU command (UPDATE BINARY):
APDU = {FF D6 00 20 10 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0Fh}
It seems fine as a get a 90 00 result...
but when i read the card back I always got the following (even with different data...):
sector: 8 (block 32), auth OK
032: D5 41 00 EA 00 FF 13 3E 86 6A 00 00 00 00 69 FF
033: D5 41 00 EA 00 FF 13 3E 86 6A 00 00 00 00 69 FF
034: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
035: 00 00 00 00 00 00 FF 07 80 69 FF FF FF FF FF FF
where does this string D5 41 00 EA 00 FF 13 3E 86 6A 00 00 00 00 69 FF come from?
Note that i didn't change any setting on the card and was properly authenticated. It was a blank card and i didn't touch the trailer.
I m using a ACR122 reader (this command comes direct from the documentation of the reader...)
Ok i found my problem, i was setting the wrong size for the cbSendLength parameter in SCardTransmit.
Now i set the correct one (the whole size of the APDU command: 21) and it works fine.
Sorry.
With an unused RFID card (MIFARE Classic 1K) that I had found in my old wallet, I've decided to clone it onto a blank card.
After executing nfc-mfclassic w X u <Original Card file name> <Blank Card file name>, I did a mfoc -O on the newly cloned blank card and the result was that everything was identically cloned as the original card. However I noticed that when comparing the dump of the newly cloned card to the dump of the clean blank card, I observed that the value of sector 0 was not cloned during the process of cloning using the nfc-mfclassic w X u command. I understand that the manufacturer block on blank cards, the manufacturer block can be clone but why in this example it's not doing that?
Below is the hex dump of the clean blank card before it was cloned.
00000000 de a0 ca 73 c7 08 04 00 01 23 8e aa 37 1d 58 1d |...s.....#..7.X.|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000030 ff ff ff ff ff ff ff 07 80 69 ff ff ff ff ff ff |.........i......|
00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000070 ff ff ff ff ff ff ff 07 80 69 ff ff ff ff ff ff |.........i......|
00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000b0 ff ff ff ff ff ff ff 07 80 69 ff ff ff ff ff ff |.........i......|
000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000f0 ff ff ff ff ff ff ff 07 80 69 ff ff ff ff ff ff |.........i......|
00000100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000130 ff ff ff ff ff ff ff 07 80 69 ff ff ff ff ff ff |.........i......|
00000140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000170 ff ff ff ff ff ff ff 07 80 69 ff ff ff ff ff ff |.........i......|
00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001b0 ff ff ff ff ff ff ff 07 80 69 ff ff ff ff ff ff |.........i......|
000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001f0 ff ff ff ff ff ff ff 07 80 69 ff ff ff ff ff ff |.........i......|
00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000220 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000230 ff ff ff ff ff ff ff 07 80 69 ff ff ff ff ff ff |.........i......|
00000240 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000250 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000260 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000270 ff ff ff ff ff ff ff 07 80 69 ff ff ff ff ff ff |.........i......|
00000280 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000290 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000002a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000002b0 ff ff ff ff ff ff ff 07 80 69 ff ff ff ff ff ff |.........i......|
000002c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000002d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000002e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000002f0 ff ff ff ff ff ff ff 07 80 69 ff ff ff ff ff ff |.........i......|
00000300 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000310 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000320 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000330 ff ff ff ff ff ff ff 07 80 69 ff ff ff ff ff ff |.........i......|
00000340 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000350 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000360 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000370 ff ff ff ff ff ff ff 07 80 69 ff ff ff ff ff ff |.........i......|
00000380 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000390 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000003a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000003b0 ff ff ff ff ff ff ff 07 80 69 ff ff ff ff ff ff |.........i......|
000003c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000003d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000003e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000003f0 ff ff ff ff ff ff ff 07 80 69 ff ff ff ff ff ff |.........i......|
00000400
The first block of sector 0 of MIFARE Classic cards is the manufacturer block. This block is read-only on regular card hardware and, thus, cannot be cloned since you cannot write it to another card.
However, there exists special hardware (dedicated card emulators, like Proxmark, and special MIFARE Classic tags from other manufacturers, so-called Chinese clone cards) which allow writing to the manufacturer block. You could use such dedicated hardware to store a clone of a genuine card incuding the first block.
I have a CRT-603-CZ1 smart card reader and I want to read 16 bytes of block 4 of a classic 1k Mifare contactless card. The authentication keys are the defualt values (i.e 0xFFFFFFFFFFFF). So I must send 3 commands to the reader as below :
Load Key APDU command
Authenticate APDU command
Read Block Data
(The corresponding APDU commands are mentioned in the above manual.)
In order to send above APDU commands, I used OpenSCTool and you can see the result in the following:
OpenSCTool:> OSC.exe -s FF82000006FFFFFFFFFFFF -s FF860000050100046000 -s FFB000
0410
Using reader with a card: CREATOR CRT-603 (CZ1) CCR RF 0
Failed to connect to card: Card is invalid or cannot be handled
OpenSCTool:> OSC.exe -s FF82000006FFFFFFFFFFFF -s FF860000050100046000 -s FFB000
0410
Using reader with a card: CREATOR CRT-603 (CZ1) CCR RF 0
Sending: FF 82 00 00 06 FF FF FF FF FF FF
Received (SW1=0x90, SW2=0x00)
Sending: FF 86 00 00 05 01 00 04 60 00
Received (SW1=0x90, SW2=0x00)
Sending: FF B0 00 04 10
Received (SW1=0x90, SW2=0x00):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
OpenSCTool:> OSC.exe -s FF82000006FFFFFFFFFFFF -s FF860000050100046000 -s FFB000
0410
Using reader with a card: CREATOR CRT-603 (CZ1) CCR RF 0
Failed to connect to card: Card is invalid or cannot be handled
OpenSCTool:> OSC.exe -s FF82000006FFFFFFFFFFFF -s FF860000050100046000 -s FFB000
0410
Using reader with a card: CREATOR CRT-603 (CZ1) CCR RF 0
Sending: FF 82 00 00 06 FF FF FF FF FF FF
Received (SW1=0x90, SW2=0x00)
Sending: FF 86 00 00 05 01 00 04 60 00
Received (SW1=0x90, SW2=0x00)
Sending: FF B0 00 04 10
Received (SW1=0x90, SW2=0x00):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
OpenSCTool:> OSC.exe -s FF82000006FFFFFFFFFFFF -s FF860000050100046000 -s FFB000
0410
Using reader with a card: CREATOR CRT-603 (CZ1) CCR RF 0
Failed to connect to card: Card is invalid or cannot be handled
OpenSCTool:> OSC.exe -s FF82000006FFFFFFFFFFFF -s FF860000050100046000 -s FFB000
0410
Using reader with a card: CREATOR CRT-603 (CZ1) CCR RF 0
Sending: FF 82 00 00 06 FF FF FF FF FF FF
Received (SW1=0x90, SW2=0x00)
Sending: FF 86 00 00 05 01 00 04 60 00
Received (SW1=0x69, SW2=0x83)
Sending: FF B0 00 04 10
Received (SW1=0x69, SW2=0x82)
OpenSCTool:>
As you see above, I tried these there commands more than one time. but I didn't receive the same response.
Sometimes I receive an error "Failed to connect to card: Card is invalid or cannot be handled"
Sometimes all three command return 0x9000,0x9000 and 0x9000 as the status words.
And sometimes I receive 0x9000, 0x6983 and 0x6982 as the APDU response status words.
Note that I don't change anything about the reader or card during repeating above command. Everything is fixed.
What's wrong?
Update:
Note that this reader has a tool that it works fine for the same APDU commands. Look:
These are contents of log section:
SCardTransmit...OK Send Buffer : FF B0 00 04 10 Receive Buffer : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90 00
SCardTransmit...OK Send Buffer : FF 82 00 00 06 FF FF FF FF FF FF Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF 86 00 00 05 01 00 04 60 00 Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF B0 00 04 10 Receive Buffer : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90 00
SCardTransmit...OK Send Buffer : FF 82 00 00 06 FF FF FF FF FF FF Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF 86 00 00 05 01 00 04 60 00 Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF B0 00 04 10 Receive Buffer : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90 00
SCardTransmit...OK Send Buffer : FF 82 00 00 06 FF FF FF FF FF FF Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF 86 00 00 05 01 00 04 60 00 Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF B0 00 04 10 Receive Buffer : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90 00
SCardTransmit...OK Send Buffer : FF 82 00 00 06 FF FF FF FF FF FF Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF 86 00 00 05 01 00 04 60 00 Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF B0 00 04 10 Receive Buffer : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90 00
SCardTransmit...OK Send Buffer : FF 82 00 00 06 FF FF FF FF FF FF Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF 86 00 00 05 01 00 04 60 00 Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF B0 00 04 10 Receive Buffer : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90 00
SCardTransmit...OK Send Buffer : FF 82 00 00 06 FF FF FF FF FF FF Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF 86 00 00 05 01 00 04 60 00 Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF B0 00 04 10 Receive Buffer : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90 00
SCardTransmit...OK Send Buffer : FF 82 00 00 06 FF FF FF FF FF FF Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF 86 00 00 05 01 00 04 60 00 Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF B0 00 04 10 Receive Buffer : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90 00
SCardTransmit...OK Send Buffer : FF 82 00 00 06 FF FF FF FF FF FF Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF 86 00 00 05 01 00 04 60 00 Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF B0 00 04 10 Receive Buffer : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90 00
SCardTransmit...OK Send Buffer : FF 82 00 00 06 FF FF FF FF FF FF Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF 86 00 00 05 01 00 04 60 00 Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF B0 00 04 10 Receive Buffer : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90 00
SCardTransmit...OK Send Buffer : FF 82 00 00 06 FF FF FF FF FF FF Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF 86 00 00 05 01 00 04 60 00 Receive Buffer : 90 00
SCardTransmit...OK Send Buffer : FF B0 00 04 10 Receive Buffer : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90 00
As you see, all the response for different tries are equal.
So
can I conclude "There is no problem with the reader, and there is a problem with the OpenSCTool"?
How can I solve this issue?
Update 2:
I wrote a Python program using PySCard library to send above three commands in a row for 5 times. And all the five series have successful equal result (i.e 0x9000 for all 5*3 =15 commands). So it seems that there is problem with OpenSCTool.but I don't know what is the problem and why it respond like this.
I am trying to use a PN532(NFC controller). Lately something in my SPI-communication is off. I start comunication by asking for the firmewareversion (D4 02). Next I try to set the SAM-Config. But the PN532 wont give an ACK nor an response.
What I observed is this. (all in hex)
GetFirmewareversion --- ACK<br>
MOSI: 01 00 00 FF 02 FE D4 02 2A 00 --- 02 00 03 00 00 00 00 00 00<br>
MISO: 00 FF FF FF FF FF FF FF FF FF --- FF 01 01 00 00 FF 00 FF 00
Receive Firmewareversion after ACK<br>
MOSI: 02 00 03 00 00 00 00 00 00 00 00 00 00 00 00<br>
MISO: 00 01 01 00 FF 06 FA D5 03 32 01 06 07 E8 00
Set SAMConfig --- see if ready(endless)<br>
MOSI: 01 00 00 FF 05 FB D4 14 01 14 01 02 00 --- 02 00 --- 02 00 --- 02 00<br>
MISO: AA AA AA AA AA AA AA AA AA FF FF FF FF --- FF 00 --- 00 00 --- 00 00
When I write my getFiremware he responds 0xFF, but when i try to set SAM he always responds with 0xAA. He also never replies an ACK or response to setSAMConfig.
Where is my Mistake? where is this Coming from? How to fix it?
THX in advance.
Insert some delay after asserting the PN532 chip select.
Had the same problem, this works for me:
void pn532_select (void)
{
FIO2CLR = PN532_CS; // assert CS
msleep (1); // relax a bit
}