chore(core): enable debuglink compilation on button models
What changed, and why it matters
This commit changes build configuration files for several Trezor hardware wallet models so that a special debug helper file for physical buttons is included only when the 'usb_iface_debug' feature is requested. It does not change user-facing behavior in normal production builds. The change appears to be a build-system cleanup to make debug-only button code compile correctly on button-based devices, not a fix for an active security vulnerability.
No immediate action required. Treat as a routine build maintenance change. If reviewing for security, verify that 'usb_iface_debug' is disabled in production release configurations and that button_debug.c does not expose unauthorized input injection when enabled.
Security signals we found
Debug-only code path enabled behind an existing feature flag
No change to runtime logic, cryptographic operations, or user confirmation flows
No privilege boundary crossed in production builds
Build-system-only change with no changelog entry
Evidence from the diff
The patch adds conditional inclusion of embed/io/button/button_debug.c to SCons model definitions for T2B1, T3B1, and T3W1 (both emulator and real hardware variants) when ‘usb_iface_debug’ is present in features_wanted. Previously, button models did not compile this debug source even when the debug USB interface was enabled, while touch models already had analogous touch_debug.c handling. The change is gated behind the debug feature flag, so production firmware without that flag is unaffected.
Changed components
core/site_scons/models/T2B1/emulator.pycore/site_scons/models/T2B1/trezor_r_v10.pycore/site_scons/models/T3B1/emulator.pycore/site_scons/models/T3B1/trezor_t3b1_revB.pycore/site_scons/models/T3W1/emulator.pycore/site_scons/models/T3W1/trezor_t3w1_revC.pyembed/io/button/button_debug.c (referenced, not modified)Inspect captured patch +14 / −0
diff --git a/core/site_scons/models/T2B1/emulator.py b/core/site_scons/models/T2B1/emulator.py
index 37980b37..0e6db4b7 100644
--- a/core/site_scons/models/T2B1/emulator.py
+++ b/core/site_scons/models/T2B1/emulator.py
@@ -70,6 +70,9 @@ def configure(
features_available.append("button")
defines += [("USE_BUTTON", "1")]
+ if "usb_iface_debug" in features_wanted:
+ sources += ["embed/io/button/button_debug.c"]
+
sources += ["embed/sys/flash/stm32f4/flash_layout.c"]
return features_available
diff --git a/core/site_scons/models/T2B1/trezor_r_v10.py b/core/site_scons/models/T2B1/trezor_r_v10.py
index d64b4b48..945b4f1e 100644
--- a/core/site_scons/models/T2B1/trezor_r_v10.py
+++ b/core/site_scons/models/T2B1/trezor_r_v10.py
@@ -70,6 +70,9 @@ def configure(
features_available.append("button")
defines += [("USE_BUTTON", "1")]
+ if "usb_iface_debug" in features_wanted:
+ sources += ["embed/io/button/button_debug.c"]
+
if "sbu" in features_wanted:
sources += ["embed/io/sbu/stm32/sbu.c"]
paths += ["embed/io/sbu/inc"]
diff --git a/core/site_scons/models/T3B1/emulator.py b/core/site_scons/models/T3B1/emulator.py
index 0cba6e6f..eab0548e 100644
--- a/core/site_scons/models/T3B1/emulator.py
+++ b/core/site_scons/models/T3B1/emulator.py
@@ -70,6 +70,9 @@ def configure(
features_available.append("button")
defines += [("USE_BUTTON", "1")]
+ if "usb_iface_debug" in features_wanted:
+ sources += ["embed/io/button/button_debug.c"]
+
sources += ["embed/sys/flash/stm32u5/flash_layout.c"]
return features_available
diff --git a/core/site_scons/models/T3B1/trezor_t3b1_revB.py b/core/site_scons/models/T3B1/trezor_t3b1_revB.py
index 8fed9260..42d0fb95 100644
--- a/core/site_scons/models/T3B1/trezor_t3b1_revB.py
+++ b/core/site_scons/models/T3B1/trezor_t3b1_revB.py
@@ -70,6 +70,9 @@ def configure(
features_available.append("button")
defines += [("USE_BUTTON", "1")]
+ if "usb_iface_debug" in features_wanted:
+ sources += ["embed/io/button/button_debug.c"]
+
if "sbu" in features_wanted:
sources += ["embed/io/sbu/stm32/sbu.c"]
paths += ["embed/io/sbu/inc"]
diff --git a/core/site_scons/models/T3W1/emulator.py b/core/site_scons/models/T3W1/emulator.py
index 044c4af6..c15f1de4 100644
--- a/core/site_scons/models/T3W1/emulator.py
+++ b/core/site_scons/models/T3W1/emulator.py
@@ -122,6 +122,7 @@ def configure(
if "usb_iface_debug" in features_wanted:
sources += ["embed/io/touch/touch_debug.c"]
+ sources += ["embed/io/button/button_debug.c"]
if "ble" in features_wanted:
sources += ["embed/io/ble/unix/ble.c"]
diff --git a/core/site_scons/models/T3W1/trezor_t3w1_revC.py b/core/site_scons/models/T3W1/trezor_t3w1_revC.py
index 8319d1a1..c4257b9f 100644
--- a/core/site_scons/models/T3W1/trezor_t3w1_revC.py
+++ b/core/site_scons/models/T3W1/trezor_t3w1_revC.py
@@ -109,6 +109,7 @@ def configure(
]
if "usb_iface_debug" in features_wanted:
sources += ["embed/io/touch/touch_debug.c"]
+ sources += ["embed/io/button/button_debug.c"]
sources += ["embed/sys/i2c_bus/stm32u5/i2c_bus.c"]
paths += ["embed/sys/i2c_bus/inc"]
Why this scored 19/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.