feat(core): add __WFI to suspend charging loop.
What changed, and why it matters
This commit adds a single CPU instruction called __WFI (Wait For Interrupt) inside the charging loop of a Trezor hardware wallet's suspend routine. It tells the processor to idle until an interrupt occurs, which is a normal power-saving measure. There is no direct evidence in the commit that this fixes a security vulnerability; it appears to be a power-management or stability improvement.
No immediate security action required. Treat as a routine firmware improvement. If reviewing for security, verify that interrupts intended to wake the device from suspend are correctly configured and that __WFI() does not mask any critical safety or tamper-detection interrupt.
Security signals we found
No security-relevant keywords in commit title or message
No changelog entry provided
Change is limited to a single power-management instruction
No modification of authentication, crypto, or memory handling code
No references to CVEs, advisories, or researchers in commit materials
Evidence from the diff
The patch inserts __WFI() into the do-while loop in system_suspend() on the STM32U5 platform. The loop polls wakeup_flags while charging_in_suspend is true. Without __WFI(), the CPU spins actively, consuming power and generating heat. Adding __WFI() allows the core to enter a low-power state until an interrupt wakes it. This is a standard embedded power-management pattern. The change is minimal (+2 lines including blank line) and does not alter control flow, authentication, cryptography, memory safety, or peripheral access logic.
Changed components
core/embed/sys/suspend/stm32u5/suspend.cTrezor Model T / Safe hardware wallet suspend/charging subsystem (STM32U5 variant)Inspect captured patch +2 / −0
diff --git a/core/embed/sys/suspend/stm32u5/suspend.c b/core/embed/sys/suspend/stm32u5/suspend.c
index f5492c4cb..763ad6869 100644
--- a/core/embed/sys/suspend/stm32u5/suspend.c
+++ b/core/embed/sys/suspend/stm32u5/suspend.c
@@ -89,6 +89,8 @@ wakeup_flags_t system_suspend(void) {
charging_in_suspend = false;
}
+ __WFI();
+
wakeup_flags_get(&wakeup_flags);
} while (charging_in_suspend && (wakeup_flags == 0));
Why this scored 11/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.