build(core): fix NFC feature propagation at emulator
What changed, and why it matters
This is a build-system-only change that moves where the NFC feature flag is defined so the emulator compiles correctly. It does not change any runtime behavior, user-facing functionality, or security logic.
No security action needed; treat as a normal build fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit relocates the nfc Cargo feature from the top-level firmware crate into the upymod crate and adjusts the n1w1 feature mapping so that io/nfc.h is properly included in emulator builds. The diff is limited to three Cargo.toml/project.toml files; no source code or security-sensitive logic is modified.
Changed components
core/embed/projects/firmware/Cargo.tomlcore/embed/projects/firmware/project.tomlcore/embed/upymod/Cargo.tomlInspect captured patch +3 / −4
### core/embed/projects/firmware/Cargo.toml
@@ -120,7 +120,6 @@ hash_processor = ["sec/hash_processor"]
iwdg = ["sec/iwdg"]
lockable_bootloader = ["io/lockable_bootloader"]
mcu_attestation = ["sec/mcu_attestation", "upymod/mcu_attestation"]
-nfc = ["io/nfc", "upymod/nfc"]
nrf = ["io/nrf"]
nrf_auth = ["io/nrf_auth"]
optiga = ["sec/optiga", "upymod/optiga", "trezor_lib/optiga"]
### core/embed/projects/firmware/project.toml
@@ -69,7 +69,7 @@ force-bootloader-upgrade = { true = ["force_bootloader_upgrade"] }
frozen = { true = ["frozen"] }
log-stack-usage = { true = ["log_stack_usage"] }
mem-perf = { true = ["memperf"] }
-n1w1 = { true = ["n1w1", "nfc"] } # TODO: move back to `uses` section (after stabilization)
+n1w1 = { true = ["n1w1"] } # TODO: move back to `uses` section (after stabilization)
perf-overlay = { true = ["ui_performance_overlay"] }
production = { true = ["production"], false = ["dev_keys"] }
pyopt = { true = ["pyopt"], false = ["debug", "optiga_testing", "ui_debug_overlay"] }
### core/embed/upymod/Cargo.toml
@@ -51,7 +51,8 @@ layout_eckhart = []
log_stack_usage = []
mcu_attestation = ["sec/mcu_attestation"]
memperf = []
-n1w1 = []
+n1w1 = ["nfc"]
+nfc = ["io/nfc"]
nem = []
optiga = ["sec/optiga"]
power_manager = ["io/power_manager"]
@@ -65,7 +66,6 @@ touch = ["io/touch"]
touch_wakeup = ["io/touch_wakeup"]
tropic = ["sec/tropic"]
universal_fw = ["crypto/universal_fw"]
-nfc = []
# --------------------------------------------------------------------------
# Automatically derived features (do not enable from outside)Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.