You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ISO-DEP timeout overrides and configurable NFC-A RATS FSDI/CID #5
Those are small bug fixes. While this issue is for discussing two follow-up API needs before opening more PRs.
1. Per-exchange ISO-DEP timeout override
Some ISO-DEP applications have command-specific processing time longer than the default ATS-derived FWT. In our case, some Aliro commands can take longer because of certificate/crypto processing.
It would be useful to support per-exchange timeout options, for example:
override initial fwt_ms for one transceiveINF()
override wtx_max_ms
optionally disable/reduce retries for non-idempotent commands
This avoids changing global ISO-DEP config mid-session and avoids resetting block-number state.
2. Configurable NFC-A RATS FSDI/CID
Current higher-level NFC-A activation sends RATS internally with default parameters. For some ISO-DEP applications, the caller may want to request a larger FSDI, e.g. FSDI=8, or specify CID.
A possible API shape could be an activation options struct:
I'm currently investigating and reviewing the matter.
I have other tasks to attend to, so I can’t respond right away, but please bear with me for a moment.
Thanks for the detailed proposal — both additions are implemented and now on develop (will ship in the next release).
1. Per-exchange ISO-DEP timeout/retry override
A policy_t can be passed per call to transceiveINF / transceiveAPDU (nullptr = use the session config). It does not change the session config and does not reset the block number:
namespacem5::nfc::isodep {
structpolicy_t {
uint32_t fwt_ms{}; //!< Frame waiting time (ms). 0 is clamped to 1 internallyuint32_t wtx_max_ms{}; //!< Upper bound for WTX extension (ms)uint8_t max_retries{}; //!< Number of resends (0 = no resend)
};
}
boolIsoDEP::transceiveINF (..., RxInfo* info = nullptr, constpolicy_t* override_policy = nullptr);
boolIsoDEP::transceiveAPDU(..., constpolicy_t* override_policy = nullptr);
auto* dep = nfc_a.isoDEP(); // nfc_b.isoDEP() too -- shared ISO-DEP layer
m5::nfc::isodep::policy_t p{2000, 8000, 0}; // long fwt, no retry (non-idempotent command)
dep->transceiveAPDU(rx, rx_len, cmd, len, &p);
This covers the per-exchange fwt_ms / wtx_max_ms override and max_retries = 0 for non-idempotent commands, without touching the global config or block-number state. It works for both NFC-A and NFC-B via the shared ISO-DEP layer.
2. Configurable NFC-A RATS FSDI/CID
Instead of new activate(...) overloads, this is a layer-level config set once before activation -- the select / activate / reactivate signatures are unchanged:
auto c = layerA.config();
c.fsdi = 8;
c.cid = 3;
layerA.config(c);
layerA.activate(picc); // RATS now sent with FSDI=8, CID=3
Internally nfca_request_ats() builds the RATS PARAM byte as (FSDI << 4) | CID from these values; reactivate() inherits via activate(). We chose a layer config (set once) over per-call activation options because FSDI/CID are PCD-side, fairly static settings, and this keeps the activation API unchanged.
Both were verified on hardware (Core / M5NanoC6 / NessoN1 / CapCC1101, I2C & SPI) with DESFire / MIFARE Plus / ST25TA and an NFC-B card. There's also a new examples/UnitUnified/NFCA/PolicyOverride demonstrating the timeout override.
Can you also help rebase the feat/esp-idf-native-support branch at that time? (It would be best if the ESP-IDF native support branch can be merged to main at the same time, but you can always take your time.)
Native esp-idf support was originally scheduled to be implemented alongside the M5HAL update.
If this is essential for your project, we will consider merging esp-idf support for M5UnitUnified, M5Utility, M5HAL, and M5Unit-NFC into the main branch ahead of schedule.
If this is essential for your project, we will consider merging esp-idf support for M5UnitUnified, M5Utility, M5HAL, and M5Unit-NFC into the main branch ahead of schedule.
This couldn't be better!
Our plan to release Aliro SDK and examples is around first week of June, but it is not like a hard requirement for you guys, seeing things are moving forward is enough.
Activity
GOB52 commentedon May 21, 2026
I'm currently investigating and reviewing the matter.
I have other tasks to attend to, so I can’t respond right away, but please bear with me for a moment.
Sped0n commentedon May 21, 2026
also is it possible to take a look at m5stack/M5UnitUnified#1
huge thanks!
Adds configurable NFC-A activation RATS FSDI/CID
Adds per-call ISO-DEP timeout override
GOB52 commentedon May 22, 2026
Thanks for the detailed proposal — both additions are implemented and now on
develop(will ship in the next release).1. Per-exchange ISO-DEP timeout/retry override
A
policy_tcan be passed per call totransceiveINF/transceiveAPDU(nullptr= use the session config). It does not change the session config and does not reset the block number:This covers the per-exchange
fwt_ms/wtx_max_msoverride andmax_retries = 0for non-idempotent commands, without touching the global config or block-number state. It works for both NFC-A and NFC-B via the shared ISO-DEP layer.2. Configurable NFC-A RATS FSDI/CID
Instead of new
activate(...)overloads, this is a layer-level config set once before activation -- theselect/activate/reactivatesignatures are unchanged:Internally
nfca_request_ats()builds the RATS PARAM byte as(FSDI << 4) | CIDfrom these values;reactivate()inherits viaactivate(). We chose a layer config (set once) over per-call activation options because FSDI/CID are PCD-side, fairly static settings, and this keeps the activation API unchanged.Both were verified on hardware (Core / M5NanoC6 / NessoN1 / CapCC1101, I2C & SPI) with DESFire / MIFARE Plus / ST25TA and an NFC-B card. There's also a new
examples/UnitUnified/NFCA/PolicyOverridedemonstrating the timeout override.Thanks again, and for #3 (merged).
Sped0n commentedon May 22, 2026
Can you also help rebase the feat/esp-idf-native-support branch at that time? (It would be best if the ESP-IDF native support branch can be merged to main at the same time, but you can always take your time.)
Thanks!
GOB52 commentedon May 22, 2026
Native esp-idf support was originally scheduled to be implemented alongside the M5HAL update.
If this is essential for your project, we will consider merging esp-idf support for M5UnitUnified, M5Utility, M5HAL, and M5Unit-NFC into the main branch ahead of schedule.
Sped0n commentedon May 22, 2026
This couldn't be better!
Our plan to release Aliro SDK and examples is around first week of June, but it is not like a hard requirement for you guys, seeing things are moving forward is enough.
Sped0n commentedon May 25, 2026
is it possible to sync changes in #4 (comment) to the feat/esp-idf-native-support branch, thanks!