What changed, and why it matters
This commit adds a simple diagnostic command called 'prodtest-uptime' to Trezor's production-test firmware. It only reports how long the device has been powered on, in milliseconds. There is no indication it changes security behavior, handles secrets, or opens any attack path.
No security action required. Treat as a normal feature addition.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change introduces a new CLI command prodtest-uptime in the prodtest project. The command takes no arguments and returns systick_ms(), a monotonic millisecond counter since boot, formatted via cli_ok(). It adds no memory access beyond the existing CLI framework, no authentication changes, no cryptographic operations, and no new dependencies beyond <sys/systick.h>.
Changed components
core/embed/projects/prodtest/cmd/prodtest_prodtest.ccore/embed/projects/prodtest/README.mdInspect captured patch +27 / −0
diff --git a/core/embed/projects/prodtest/.changelog.d/+uptime.added b/core/embed/projects/prodtest/.changelog.d/+uptime.added
new file mode 100644
index 00000000..d0a5d222
--- /dev/null
+++ b/core/embed/projects/prodtest/.changelog.d/+uptime.added
@@ -0,0 +1 @@
+Add `prodtest-uptime` command returning the device uptime in milliseconds.
diff --git a/core/embed/projects/prodtest/README.md b/core/embed/projects/prodtest/README.md
index 8538e155..957d2968 100644
--- a/core/embed/projects/prodtest/README.md
+++ b/core/embed/projects/prodtest/README.md
@@ -806,6 +806,15 @@ prodtest-mem-read
OK 01020304
```
+### prodtest-uptime
+Returns the device uptime (time elapsed since the last boot) in milliseconds.
+
+Example:
+```
+prodtest-uptime
+OK 123456
+```
+
### secrets-init
Generates random secrets and stores them in the protected storage.
diff --git a/core/embed/projects/prodtest/cmd/prodtest_prodtest.c b/core/embed/projects/prodtest/cmd/prodtest_prodtest.c
index 5c6acda7..26d61efe 100644
--- a/core/embed/projects/prodtest/cmd/prodtest_prodtest.c
+++ b/core/embed/projects/prodtest/cmd/prodtest_prodtest.c
@@ -23,6 +23,7 @@
#include <rtl/cli.h>
#include <sec/fwutils.h>
+#include <sys/systick.h>
#include "prodtest_error_codes.h"
@@ -116,6 +117,15 @@ static void prodtest_mem_read(cli_t* cli) {
cli_ok_hexdata(cli, mem_buffer, mem_buffer_len);
}
+static void prodtest_uptime(cli_t* cli) {
+ if (cli_arg_count(cli) > 0) {
+ cli_error_arg_count(cli);
+ return;
+ }
+
+ cli_ok(cli, "%u", systick_ms());
+}
+
// clang-format off
PRODTEST_CLI_CMD(
@@ -159,3 +169,10 @@ PRODTEST_CLI_CMD(
.info = "Read data from RAM buffer",
.args = ""
);
+
+PRODTEST_CLI_CMD(
+ .name = "prodtest-uptime",
+ .func = prodtest_uptime,
+ .info = "Get the device uptime in milliseconds",
+ .args = ""
+);
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.