Files
proxmark3/common_arm
iceman1001andClaude Opus 5.5 05c21a33b5 PM5: mask the unused USB start of frame interrupt
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
  before 7772aa92b as well
- hf mfdes chk: 58-80 14443-4 retransmissions/run -> 1-7, 12 s -> 6 s
- hf mfdes auth -c native, client before 7772aa92b: 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.

7772aa92b and the ISO-4 recovery in eab887680 stay: 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>
2026-11-12 17:27:45 +07:00
..
2026-08-29 17:42:29 +02:00
2026-09-12 10:35:40 +02:00
2026-08-29 17:42:29 +02:00
2026-08-29 17:42:29 +02:00
2026-09-26 12:23:47 -04:00