mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-11-22 06:07:43 +00:00
The PM5 HF reader lost frames in both directions, the RDV4 did not. Same card, client and firmware source: `hf mf hardnested` nonce acquisition logged ~330 Auth1/Auth2/select errors per run on the PM5 and none on the RDV4, which is the error flood `hf mf autopwn` shows. The 14443-A reader moves one SSC word per Manchester bit, one every 9.4 us, and the AT32 SPI that carries them from the FPGA holds a single word. The reader loops poll it. usbd_core_init() unmasks the OTG start of frame interrupt, which fires every millisecond and has an empty handler in the CDC class, and whenever it landed mid frame the loop missed its bit-time. On receive that is an SPI overrun, and the overrun path in FPGA_SSC_RX_Ready() discards the buffered word as well, so every hit cost two bits: failing reads showed card replies exactly 256 carrier cycles (two bit-times) shorter than good ones. The AT91 polls USB, so nothing can preempt these loops on an RDV4. Masking SOF after usbd_init() leaves the OTG interrupt for actual transfers. Nothing in pm3 uses SOF and USB throughput is unchanged (8 readings each way, mean 665 vs 669 KB/s). The bootrom does no HF work and is left as it was. Measured on the PM5 with BWM V5, before -> after: - MFC authenticated read: 48/60 -> 60/60 - hardnested nonce acquisition: ~330 errors/run -> 0, SPI overruns -> 0 - hf mfp chk -s 0 -e 31: 0-1 of 15 keys -> 15/15, with the client from before7772aa92bas well - hf mfdes chk: 58-80 14443-4 retransmissions/run -> 1-7, 12 s -> 6 s - hf mfdes auth -c native, client before7772aa92b: 13/30 failed -> 0/30 A handful of 14443-4 retransmissions per DESFire run remain with no SPI overrun behind them; that card couples poorly at its position on this antenna.7772aa92band the ISO-4 recovery ineab887680stay: they are spec fixes for any lossy link. They were also compensating for this, which is why those paths already looked better before the cause was found. Diagnosed by counting SPI receive overruns and by masking interrupts across the reader loops, which took the errors to zero; masking only the SOF interrupt does the same without touching protocol code. Builds: PM5 and PM3RDV4 clean (file is AT32 only). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>