Skip to content

cyberpunkunicorn-os 0.1.5: read every PN532 answer before the next command - #19

Merged
hellofrequencylab merged 1 commit into
mainfrom
claude/project-thread-lhkr1c
Oct 21, 2026
Merged

hellofrequencylab merged 1 commit into
mainfrom
claude/project-thread-lhkr1c

Conversation

@hellofrequencylab

Copy link
Copy Markdown
Owner

This fixes the bug behind the card reader looking dead.

Daniel's 0.1.4 log showed PN532 firmware answered (0x32010607), and then every card search ended in "no ack". In startReader(), Adafruit's setPassiveActivationRetries() never reads the chip's answer, and SAMConfig() reads it without waiting for it. The answer left in the chip was then read in place of the next command's ACK, so every poll looked unanswered.

Changes:

  • command() sends a command, waits for the answer, and checks it (D5, CMD+1). SAMConfiguration and RFConfiguration (MaxRetries 5) now go through it, and the result is logged as [freq] PN532 setup: SAM ..., retries ....
  • When a card search runs past its wait, it is cancelled by sending an ACK frame (PN532 user manual 6.2.1.3), so its late answer can't do the same.
  • OS_VERSION is now 0.1.5.

PlatformIO can't build in the cloud session, so this PR's CI build is the compile check. It isn't hardware-tested: Daniel will install it from the Update tab.


Generated by Claude Code

…mmand

Daniel's 0.1.4 log: the PN532 answered GetFirmwareVersion, then every card
search ended 'no ack'. startReader() used Adafruit's
setPassiveActivationRetries(), which never reads the chip's answer, and
SAMConfig(), which reads it without waiting. The answer left in the chip was
read in place of the next command's ACK, so every poll looked unanswered.
Both setup commands now go through command(), which waits for and checks the
answer, and the setup result is logged. A card search that runs past its wait
is cancelled with an ACK frame so its late answer can't do the same.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Aw32AU4vVqCSEoNA5aP3U
@hellofrequencylab
hellofrequencylab merged commit 942be86 into main Oct 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants