fix(core): update battery temp in telemetry only if NTC is connected
What changed, and why it matters
This is a small firmware fix for the Trezor hardware wallet's battery monitoring. It stops the device from reporting a battery temperature to internal telemetry when the temperature sensor (NTC) is physically disconnected. Without the fix, telemetry could record an invalid or misleading temperature value. There is no direct security exploit here; it is a data-quality and robustness improvement.
Treat as a routine quality fix. No urgent security response is indicated by this commit alone. If the project tracks telemetry-driven safety decisions (e.g., charging limits based on temperature), review whether any other consumers of ntc_temp also need the ntc_disconnected guard.
Security signals we found
Defensive input-validation-style guard added
Prevents use of potentially invalid sensor data in telemetry
No memory corruption, authentication bypass, or cryptographic weakness visible in diff
Evidence from the diff
In core/embed/io/power_manager/stm32u5/power_monitoring.c, the pm_pmic_data_ready callback previously called telemetry_update_battery_temp unconditionally with drv->pmic_data.ntc_temp. The patch guards that call with if (!drv->pmic_data.ntc_disconnected), so only valid NTC readings are forwarded to telemetry. The change is defensive and prevents stale or sentinel temperature values from being logged when the NTC is not connected.
Changed components
core/embed/io/power_manager/stm32u5/power_monitoring.cBattery temperature telemetry path on STM32U5-based Trezor devicesInspect captured patch +4 / −2
diff --git a/core/embed/io/power_manager/stm32u5/power_monitoring.c b/core/embed/io/power_manager/stm32u5/power_monitoring.c
index 027929c45..ad1262dd2 100644
--- a/core/embed/io/power_manager/stm32u5/power_monitoring.c
+++ b/core/embed/io/power_manager/stm32u5/power_monitoring.c
@@ -80,8 +80,10 @@ void pm_pmic_data_ready(void* context, pmic_report_t* report) {
stwlc38_get_report(&drv->wireless_data);
#ifdef USE_TELEMETRY
- // Update telemetry with current battery temperature
- telemetry_update_battery_temp(drv->pmic_data.ntc_temp);
+ // Update telemetry with the current battery temperature
+ if (!drv->pmic_data.ntc_disconnected) {
+ telemetry_update_battery_temp(drv->pmic_data.ntc_temp);
+ }
#endif
// detect battery disconnection
Why this scored 16/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.