Skip to content

fix: wait for NFC-A frame availability before reading#4

Open
Sped0n wants to merge 1 commit into
m5stack:mainfrom
Sped0n:fix-nfca-receive-semantics
Open

fix: wait for NFC-A frame availability before reading#4
Sped0n wants to merge 1 commit into
m5stack:mainfrom
Sped0n:fix-nfca-receive-semantics

Conversation

@Sped0n
Copy link
Copy Markdown

@Sped0n Sped0n commented May 20, 2026

Problem

nfcaReceive() treated the caller-provided RX length as the expected frame size. In practice that value is the RX buffer capacity. When I_rxe is missed and FIFO fallback is used, this can wait for the FIFO to contain the full buffer capacity instead of just waiting for a received frame.

Change Overview

  • Change nfcaReceive() to wait for FIFO availability rather than full RX buffer capacity.
  • Keep the original RX length as the maximum number of bytes to read from FIFO.

Testing

No test added due to nfcaReceive() depends on real chip IRQ/FIFO behavior, platformio test -e test_UnitNFC_NanoC6 --upload-port /dev/ttyACM0 --test-port /dev/ttyACM0 show no regression on existing tests (145/145 test cases passed).

Signed-off-by: Zhibin (Ryan) Wen <wenzhibin@espressif.com>
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.

1 participant