Skip to content

Accept NTAG215 tags whose CC declares 504 bytes (0x3F) - #44

Merged
suchmememanyskill merged 1 commit into
suchmememanyskill:mainfrom
Laennart:ntag215-cc-0x3f
Nov 30, 2026
Merged

suchmememanyskill merged 1 commit into
suchmememanyskill:mainfrom
Laennart:ntag215-cc-0x3f

Conversation

@Laennart

Copy link
Copy Markdown
Contributor

Since a13bc9e the Ultralight reader looks up the physical page count from CC byte 2 and rejects anything not in FM175XX_ULTRALIGHT_PAGE_COUNTS_BY_CC_SIZE. NTAG215 tags with CC E1 10 3F 00 are now rejected:

ERROR rfid_reader:rfid_reader_right_side: Invalid or unsupported Ultralight/NTAG capability container: e1103f00
ERROR rfid_reader:rfid_reader_right_side: Mifare Ultralight read error: -29

0x3F is a valid NTAG215 CC:

  • NXP ships E1 10 3E 00 (496 bytes), per datasheet Rev. 3.2, Tables 4 and 6.
  • The user area is pages 04h–81h, which is 504 bytes = 0x3F × 8 (§8.5.5). The dynamic lock bytes start at 82h.
  • The CC "may be bit-wise modified by a WRITE or COMPATIBILITY_WRITE command" (§8.5.4). Formatters that size the CC from the user memory set bit 0, and it can't be cleared again, so these tags can't be fixed on the tag side.
  • Before a13bc9e the reader always read 135 pages, so these tags worked on earlier builds.

This maps 0x3F to 135 pages:

  • A real NTAG215 is read exactly as with 0x3E.
  • A smaller chip that falsely declares 0x3F still NAKs past its end and fails cleanly, as covered by the existing persistent-failure tests.

Tag

Genuine NXP NTAG215 used on a Snapmaker U1 with paxx12's extended firmware. NFC Tools reports:

  • valid originality signature, 135 pages
  • no password, static and dynamic lock bytes unset
  • page 3 = E1 10 3F 00

Its 540-byte dump is added as test/tags/OpenSpool/Geeetech PLA FFC5AB CC 3F.bin. It holds an OpenSpool record written with NFC Tools.

Testing

$ pytest -q test
98 passed, 1 skipped

Without the change in constants.py, two tests fail: the new synthetic ntag215-cc-504 case and the real-dump fixture.

NTAG216's equivalent (0x6F, 888 bytes) isn't in the table either. I haven't seen one in the wild, so I left it out. Happy to add it if you want.

Since a13bc9e the Ultralight reader rejects any CC size byte that is not
in FM175XX_ULTRALIGHT_PAGE_COUNTS_BY_CC_SIZE. NTAG215 tags with CC
E1 10 3F 00 declare the full 504-byte user area (pages 04h-81h) and are
valid, but are now rejected. The CC is OTP, so these tags cannot be
reset to NXP's delivery value 0x3E.

Map 0x3F to the NTAG215's 135 physical pages and add a synthetic case
plus a real tag dump as an OpenSpool fixture.
@suchmememanyskill
suchmememanyskill merged commit 9e1a467 into suchmememanyskill:main Nov 30, 2026
1 check passed
suchmememanyskill added a commit that referenced this pull request Nov 30, 2026
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