feat(core): show nRF version in About menu
What changed, and why it matters
This commit adds a new feature that displays the version of the nRF Bluetooth chip firmware in the device's About menu. It replaces a previously hardcoded placeholder version number with a real value read from the hardware. There is no security issue visible in this change.
No security action required; this is a benign feature commit. Normal code-review approval is sufficient.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch exposes a new MicroPython binding nrf_get_version() (guarded by USE_NRF) that calls nrf_get_version() from the C HAL and returns a 4-tuple of version bytes. It also exports a USE_NRF boolean constant and uses both in device_menu.py to format and show the actual nRF firmware version in the About menu, instead of the hardcoded string "2.3.1.1". The change is purely informational UI functionality.
Changed components
core/embed/upymod/modtrezorutils/modtrezorutils.ccore/mocks/generated/trezorutils.pyicore/src/apps/homescreen/device_menu.pycore/src/trezor/utils.pyInspect captured patch +60 / −1
diff --git a/core/embed/upymod/modtrezorutils/modtrezorutils.c b/core/embed/upymod/modtrezorutils/modtrezorutils.c
index 59e5f5061..7f73f0a66 100644
--- a/core/embed/upymod/modtrezorutils/modtrezorutils.c
+++ b/core/embed/upymod/modtrezorutils/modtrezorutils.c
@@ -43,6 +43,10 @@
#include "blake2s.h"
#include "memzero.h"
+#ifdef USE_NRF
+#include <io/nrf.h>
+#endif
+
#if !defined(TREZOR_EMULATOR)
#include <sec/secret.h>
#endif
@@ -577,6 +581,28 @@ STATIC mp_obj_t mod_trezorutils_notify_send(const mp_obj_t event) {
STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_trezorutils_notify_send_obj,
mod_trezorutils_notify_send);
+#ifdef USE_NRF
+/// def nrf_get_version() -> VersionTuple:
+/// """
+/// Reads version of nRF firmware
+/// """
+STATIC mp_obj_t mod_trezorutils_nrf_get_version(void) {
+ uint32_t version = nrf_get_version();
+
+ mp_obj_t nrf_version[4] = {mp_obj_new_int((version >> 24) & 0xff),
+ mp_obj_new_int((version >> 16) & 0xff),
+ mp_obj_new_int((version >> 8) & 0xff),
+ mp_obj_new_int((version >> 0) & 0xff)};
+
+ mp_obj_t version_tuple =
+ mp_obj_new_tuple(MP_ARRAY_SIZE(nrf_version), nrf_version);
+
+ return version_tuple;
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_0(mod_trezorutils_nrf_get_version_obj,
+ mod_trezorutils_nrf_get_version);
+#endif
+
STATIC mp_obj_str_t mod_trezorutils_revision_obj = {
{&mp_type_bytes}, 0, sizeof(SCM_REVISION), (const byte *)SCM_REVISION};
@@ -631,6 +657,8 @@ STATIC mp_obj_tuple_t mod_trezorutils_version_obj = {
/// """Whether the hardware supports two-button input."""
/// USE_POWER_MANAGER: bool
/// """Whether the hardware has a battery."""
+/// USE_NRF: bool
+/// """Whether the hardware has a nRF chip."""
/// MODEL: str
/// """Model name."""
/// MODEL_FULL_NAME: str
@@ -684,6 +712,10 @@ STATIC const mp_rom_map_elem_t mp_module_trezorutils_globals_table[] = {
{MP_ROM_QSTR(MP_QSTR_NOTIFY_BOOT), MP_ROM_INT(NOTIFY_BOOT)},
{MP_ROM_QSTR(MP_QSTR_NOTIFY_UNLOCK), MP_ROM_INT(NOTIFY_UNLOCK)},
{MP_ROM_QSTR(MP_QSTR_NOTIFY_LOCK), MP_ROM_INT(NOTIFY_LOCK)},
+#ifdef USE_NRF
+ {MP_ROM_QSTR(MP_QSTR_nrf_get_version),
+ MP_ROM_PTR(&mod_trezorutils_nrf_get_version_obj)},
+#endif
{MP_ROM_QSTR(MP_QSTR_unit_color),
MP_ROM_PTR(&mod_trezorutils_unit_color_obj)},
@@ -768,6 +800,11 @@ STATIC const mp_rom_map_elem_t mp_module_trezorutils_globals_table[] = {
{MP_ROM_QSTR(MP_QSTR_USE_POWER_MANAGER), mp_const_true},
#else
{MP_ROM_QSTR(MP_QSTR_USE_POWER_MANAGER), mp_const_false},
+#endif
+#ifdef USE_NRF
+ {MP_ROM_QSTR(MP_QSTR_USE_NRF), mp_const_true},
+#else
+ {MP_ROM_QSTR(MP_QSTR_USE_NRF), mp_const_false},
#endif
{MP_ROM_QSTR(MP_QSTR_MODEL), MP_ROM_PTR(&mod_trezorutils_model_name_obj)},
{MP_ROM_QSTR(MP_QSTR_MODEL_FULL_NAME),
diff --git a/core/mocks/generated/trezorutils.pyi b/core/mocks/generated/trezorutils.pyi
index 99144dc43..c2809a8e5 100644
--- a/core/mocks/generated/trezorutils.pyi
+++ b/core/mocks/generated/trezorutils.pyi
@@ -186,6 +186,13 @@ def notify_send(event: int) -> None:
"""
Sends a notification to host
"""
+
+
+# upymod/modtrezorutils/modtrezorutils.c
+def nrf_get_version() -> VersionTuple:
+ """
+ Reads version of nRF firmware
+ """
SCM_REVISION: bytes
"""Git commit hash of the firmware."""
VERSION: VersionTuple
@@ -210,6 +217,8 @@ USE_BUTTON: bool
"""Whether the hardware supports two-button input."""
USE_POWER_MANAGER: bool
"""Whether the hardware has a battery."""
+USE_NRF: bool
+"""Whether the hardware has a nRF chip."""
MODEL: str
"""Model name."""
MODEL_FULL_NAME: str
diff --git a/core/src/apps/homescreen/device_menu.py b/core/src/apps/homescreen/device_menu.py
index 2beb48b4f..d77829a22 100644
--- a/core/src/apps/homescreen/device_menu.py
+++ b/core/src/apps/homescreen/device_menu.py
@@ -82,7 +82,14 @@ async def handle_device_menu() -> None:
log.debug(__name__, "hostname_map: %s", hostname_map)
paired_devices = [_get_hostname(bond, hostname_map) for bond in bonds]
- bluetooth_version = "2.3.1.1"
+ if utils.USE_NRF:
+ nrf_version = utils.nrf_get_version()
+ bluetooth_version = (
+ f"{nrf_version[0]}.{nrf_version[1]}.{nrf_version[2]}.{nrf_version[3]}"
+ )
+ else:
+ bluetooth_version = "0.0.0.0"
+
# ###
firmware_version = ".".join(map(str, utils.VERSION))
firmware_type = "Bitcoin-only" if utils.BITCOIN_ONLY else "Universal"
diff --git a/core/src/trezor/utils.py b/core/src/trezor/utils.py
index 73761bd28..e66cecc61 100644
--- a/core/src/trezor/utils.py
+++ b/core/src/trezor/utils.py
@@ -18,6 +18,7 @@ from trezorutils import ( # noqa: F401
USE_BLE,
USE_BUTTON,
USE_HAPTIC,
+ USE_NRF,
USE_OPTIGA,
USE_POWER_MANAGER,
USE_RGB_LED,
@@ -42,6 +43,11 @@ from trezorutils import ( # noqa: F401
unit_color,
unit_packaging,
)
+
+if USE_NRF:
+ from trezorutils import nrf_get_version # noqa: F401
+
+
from typing import TYPE_CHECKING
if __debug__:
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.