Skip to content

Conversation

dogtopus
Copy link
Contributor

@dogtopus dogtopus commented Apr 24, 2025

What's new

NFC TagInfo and possibly other readers rely on Polling commands with Request Code of 1 (default System Code request) and non-FFFF System Code to detect card type. The NFC controller doesn't seem to handle the latter case in hardware and simply bubbles those commands up to the firmware layer. The firmware in its current form then gets confused and interrupts the transaction, resulting in failed reading attempts.

This PR adds a simple handler for when a Polling command with non-FFFF System Code is seen on the firmware side, so that readers behaving like NFC TagInfo could read the emulated card without failing.

Verification

  • Generate a FeliCa Lite-S .nfc file.
  • Emulate it, then use NFC TagInfo to read its contents.
  • Should be able to read the contents without any error.

Checklist (For Reviewer)

  • PR has description of feature/bug or link to Confluence/Jira task
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

NFC TagInfo and possibly other readers rely on Polling commands with Request Code of 1 (default System Code request) or non-FFFF System Code to detect card type. Since the NFC controller doesn't seem to handle them in hardware and simply bubbles them up, and then the Flipper firmware will just ignore them and refuse to respond afterwards, this causes the reading operation to fail.

This commit adds a simple handler for such Polling commands so that readers behaving like NFC TagInfo could read the emulated card without failing.
@dogtopus dogtopus changed the title FeliCa: Handle non-hardware Polling commands FeliCa Emulation: Handle non-hardware Polling commands Apr 24, 2025
@dogtopus
Copy link
Contributor Author

dogtopus commented Apr 25, 2025

Turns out I might only need to handle the non-FFFF System Code case in firmware, as #3871 suggested that Polling with System Code of FFFF and non-zero Request Code should just work. I'll set this to draft while I'm reworking this PR.

EDIT: Done.

@dogtopus dogtopus marked this pull request as draft April 25, 2025 01:35
The NFC controller should handle Polling commands with the System Code set to FFFF, so it's not necessary for the firmware to handle it.
@dogtopus dogtopus marked this pull request as ready for review April 25, 2025 02:16
We already have enough information to determine whether or not the card supports NDEF since SYS_OP register value is included in all current Lite-S card dumps.
@dogtopus
Copy link
Contributor Author

dogtopus commented Apr 25, 2025

Since the PR has now become tiny, I might also as well use this chance to implement the NDEF detection behavior. Stay tuned for a follow-up.

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