What changed, and why it matters
This is a routine cleanup change in the Nordic Bluetooth Low Energy firmware for Trezor hardware wallets. It replaces old-style printk debug messages with Zephyr's standard logging macros (LOG_ERR, LOG_WRN) and removes an unused logging configuration option. There is no security-relevant change here.
No action required. This is a non-security refactoring commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit converts printk() calls to Zephyr LOG_ERR/LOG_WRN macros in the Nordic nRF BLE firmware (pairing.c, spi.c, uart.c) and removes CONFIG_LOG_PRINTK=n from prj.conf. Since CONFIG_LOG=n and CONFIG_UART_CONSOLE=n remain disabled, the functional behavior is essentially unchanged: logs are still compiled out at runtime. This is a code-quality/logging refactor with no functional or security impact.
Changed components
nordic/trezor/trezor-ble/prj.confnordic/trezor/trezor-ble/src/ble/pairing.cnordic/trezor/trezor-ble/src/trz_comm/spi.cnordic/trezor/trezor-ble/src/trz_comm/uart.cInspect captured patch +10 / −11
diff --git a/nordic/trezor/trezor-ble/prj.conf b/nordic/trezor/trezor-ble/prj.conf
index ecdaddbb..cd8f50b2 100644
--- a/nordic/trezor/trezor-ble/prj.conf
+++ b/nordic/trezor/trezor-ble/prj.conf
@@ -108,7 +108,6 @@ CONFIG_POLL=y
CONFIG_LOG=n
CONFIG_UART_CONSOLE=n
CONFIG_LOG_BACKEND_UART=n
-CONFIG_LOG_PRINTK=n
CONFIG_NANOPB=n
diff --git a/nordic/trezor/trezor-ble/src/ble/pairing.c b/nordic/trezor/trezor-ble/src/ble/pairing.c
index 8e67b158..e8ed5a80 100644
--- a/nordic/trezor/trezor-ble/src/ble/pairing.c
+++ b/nordic/trezor/trezor-ble/src/ble/pairing.c
@@ -143,13 +143,13 @@ void pairing_reset(void) {
bool pairing_init(void) {
int err = bt_conn_auth_cb_register(&conn_auth_callbacks);
if (err) {
- printk("Failed to register authorization callbacks.\n");
+ LOG_ERR("Failed to register authorization callbacks.");
return false;
}
err = bt_conn_auth_info_cb_register(&conn_auth_info_callbacks);
if (err) {
- printk("Failed to register authorization info callbacks.\n");
+ LOG_ERR("Failed to register authorization info callbacks.");
return false;
}
diff --git a/nordic/trezor/trezor-ble/src/trz_comm/spi.c b/nordic/trezor/trezor-ble/src/trz_comm/spi.c
index a0d6d1ed..80be37db 100644
--- a/nordic/trezor/trezor-ble/src/trz_comm/spi.c
+++ b/nordic/trezor/trezor-ble/src/trz_comm/spi.c
@@ -107,10 +107,10 @@ void spi_init(void) {
spi_dev = DEVICE_DT_GET(MY_SPI_MASTER);
if (!device_is_ready(spi_dev)) {
- printk("SPI master device not ready!\n");
+ LOG_WRN("SPI master device not ready!");
}
if (!device_is_ready(spim_cs.gpio.port)) {
- printk("SPI master chip select device not ready!\n");
+ LOG_WRN("SPI master chip select device not ready!");
}
k_sem_give(&spi_comm_ok);
@@ -118,14 +118,14 @@ void spi_init(void) {
bool spi_send(uint8_t service_id, const uint8_t *data, uint32_t len) {
if (len > MAX_SPI_DATA_SIZE) {
- printk("Too big data\n");
+ LOG_WRN("Too big data");
return false;
}
trz_packet_t *tx = k_malloc(sizeof(*tx));
if (tx == NULL) {
- printk("Not able to allocate SPI send data buffer\n");
+ LOG_WRN("Not able to allocate SPI send data buffer");
return false;
}
@@ -162,7 +162,7 @@ void spi_thread(void) {
uint8_t *rx_data = k_malloc(PACKET_DATA_SIZE);
if (rx_data == NULL) {
- printk("Not able to allocate SPI receive data buffer\n");
+ LOG_WRN("Not able to allocate SPI receive data buffer");
k_free(buf);
continue;
}
@@ -187,7 +187,7 @@ void spi_thread(void) {
}
if (spi_transceive(spi_dev, &spi_cfg, txp, &rx) != 0) {
- printk("SPI Data not sent\n");
+ LOG_WRN("SPI Data not sent");
}
spi_packet_t *rx_msg = (spi_packet_t *)rx_data;
@@ -198,7 +198,7 @@ void spi_thread(void) {
process_rx_msg(rx_msg->service_id & 0xF, rx_msg->data, rx_msg->msg_len);
} else {
if (rx_msg->service_id != 0) {
- printk("SPI RX invalid data\n");
+ LOG_WRN("SPI RX invalid data");
}
}
diff --git a/nordic/trezor/trezor-ble/src/trz_comm/uart.c b/nordic/trezor/trezor-ble/src/trz_comm/uart.c
index bc572d02..fc2d7bb9 100644
--- a/nordic/trezor/trezor-ble/src/trz_comm/uart.c
+++ b/nordic/trezor/trezor-ble/src/trz_comm/uart.c
@@ -294,6 +294,6 @@ void uart_power_down(void) {
/* Power down the UART device */
err = pm_device_action_run(uart, PM_DEVICE_ACTION_SUSPEND);
if (err) {
- printk("pm_device_action_run() failed (%d)\n", err);
+ LOG_ERR("pm_device_action_run() failed (%d)", err);
}
}
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.