From 8f0da9640cc1be3a74b385bdbe8b2c59ce7e5dd3 Mon Sep 17 00:00:00 2001 From: michael Date: Fri, 3 Jul 2026 11:30:12 -0700 Subject: [PATCH] refactor: de-ALM Ntag5Boost, seed NTA5332 ALM config defaults Document ALM as analog-only with no command surface, and seed config blocks 0x40-0x44 with the NTA5332 datasheet Rev 3.4 Table 76 defaults (ALM_CONF/ALM_LUT) so a client reading config memory sees the same bytes a real NTA5332 returns. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../hf/iso15693/nxp/ntag5_boost.py | 36 ++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/pm3py/transponders/hf/iso15693/nxp/ntag5_boost.py b/pm3py/transponders/hf/iso15693/nxp/ntag5_boost.py index abc130c..783cb41 100644 --- a/pm3py/transponders/hf/iso15693/nxp/ntag5_boost.py +++ b/pm3py/transponders/hf/iso15693/nxp/ntag5_boost.py @@ -1,23 +1,43 @@ -"""NTAG 5 Boost (NTA5332) — compact I2C bridge with ALM and AES. +"""NTAG 5 Boost (NTA5332) — compact I2C bridge, AES always enabled. -NTAG 5 Link + Active Load Modulation + AES always enabled. -Same memory layout and I2C interface as Link NTP5332. +NXP NTA5332: same NFC Type 5 / ISO 15693 protocol, memory layout, and +I2C interface as NTAG 5 Link NTP5332, but with AES permanently enabled. 512 user blocks (2048 bytes) + 256-byte SRAM + config memory. -ALM (Active Load Modulation) is an RF modulation technique that -reduces antenna size without compromising read range. It has no -protocol-level impact — the sim model is identical to Link NTP5332. +At the command layer it is indistinguishable from a Link NTP5332 with AES +on — there are no ALM-specific commands. The physical NTA5332 adds Active +Load Modulation (an analog TX technique for smaller antennas) configured +purely through config-memory blocks 0x40-0x44 (ALM_CONF/ALM_LUT). ALM has +no protocol impact and nothing to simulate, but we seed those blocks with +the datasheet default content so a client reading config memory sees the +same bytes a real NTA5332 returns. """ from __future__ import annotations from .ntag5_link import Ntag5LinkTag +# ALM config-memory defaults (NTA5332 datasheet Rev 3.4, Table 76). +# Analog driver tuning only (field-detect threshold, phase offset, ALM LUT) +# with no protocol behavior — present so a config dump of the sim matches a +# real NTA5332. block -> 4 bytes. +_ALM_CONFIG_DEFAULTS = { + 0x40: bytes((0x81, 0xFC, 0x5E, 0xCF)), # ALM_CONF_00..03 + 0x41: bytes((0x1F, 0x1F, 0x17, 0x14)), # ALM_LUT_00..03 + 0x42: bytes((0x13, 0x13, 0x12, 0x12)), # ALM_LUT_04..07 + 0x43: bytes((0x10, 0x10, 0xF0, 0xF0)), # ALM_LUT_08..11 + 0x44: bytes((0xF0, 0xF0, 0xF0, 0xF0)), # ALM_LUT_12..15 +} + class Ntag5BoostTag(Ntag5LinkTag): - """NTAG 5 Boost transponder (NTA5332). + """NTAG 5 Boost (NTA5332) = Link NTP5332 with AES always enabled. - = NTAG 5 Link NTP5332 + ALM. AES always enabled. + ALM is analog-only and has no command surface; the ALM config blocks + (0x40-0x44) are seeded with datasheet defaults so a config dump of the + sim matches a real NTA5332 for client-application testing. """ def __init__(self, uid: bytes | str | None = None, **kwargs): super().__init__(uid=uid, aes_capable=True, **kwargs) + for block, data in _ALM_CONFIG_DEFAULTS.items(): + self._config_memory[block * 4 : block * 4 + 4] = data