From 165e75bbb7ecb79e6ee2dc19adf553a289c56b6b Mon Sep 17 00:00:00 2001 From: tychovrahe Date: Fri, 16 May 2025 10:48:52 +0200 Subject: [PATCH] chore(nordic): debug/prod configuration [no changelog] --- nordic/trezor/README.md | 6 ++++-- nordic/trezor/radio_test/debug.conf | 17 +++++++++++++++++ nordic/trezor/radio_test/sysbuild/mcuboot.conf | 5 +++-- .../radio_test/sysbuild/mcuboot_debug.conf | 11 +++++++++++ .../radio_test/sysbuild/mcuboot_prod.conf | 7 +++++++ nordic/trezor/trezor-ble/prod.conf | 7 +++++++ nordic/trezor/trezor-ble/sysbuild/mcuboot.conf | 4 ++-- .../trezor-ble/sysbuild/mcuboot_debug.conf | 11 +++++++++++ .../trezor-ble/sysbuild/mcuboot_prod.conf | 7 +++++++ 9 files changed, 69 insertions(+), 6 deletions(-) create mode 100644 nordic/trezor/radio_test/debug.conf create mode 100644 nordic/trezor/radio_test/sysbuild/mcuboot_debug.conf create mode 100644 nordic/trezor/radio_test/sysbuild/mcuboot_prod.conf create mode 100644 nordic/trezor/trezor-ble/prod.conf create mode 100644 nordic/trezor/trezor-ble/sysbuild/mcuboot_debug.conf create mode 100644 nordic/trezor/trezor-ble/sysbuild/mcuboot_prod.conf diff --git a/nordic/trezor/README.md b/nordic/trezor/README.md index 99fe6e8d89..e40daaadac 100644 --- a/nordic/trezor/README.md +++ b/nordic/trezor/README.md @@ -86,9 +86,11 @@ west flash ``` -### Build MCUBoot bootloader +### Build MCUBoot bootloader, debug, prod, default ```sh -west build ./trezor-ble -b t3w1_revA_nrf52832 --sysbuild --domain mcuboot -- -DOVERLAY_CONFIG=debug.conf +west build ./trezor-ble -b t3w1_revA_nrf52832 --sysbuild --domain mcuboot -- -Dmcuboot_EXTRA_CONF_FILE="$PWD/trezor-ble/sysbuild/mcuboot.conf;$PWD/trezor-ble/sysbuild/mcuboot_debug.conf" +west build ./trezor-ble -b t3w1_revA_nrf52832 --sysbuild --domain mcuboot -- -Dmcuboot_EXTRA_CONF_FILE="$PWD/trezor-ble/sysbuild/mcuboot.conf;$PWD/trezor-ble/sysbuild/prod.conf" +west build ./trezor-ble -b t3w1_revA_nrf52832 --sysbuild --domain mcuboot ``` ### Build Application diff --git a/nordic/trezor/radio_test/debug.conf b/nordic/trezor/radio_test/debug.conf new file mode 100644 index 0000000000..09b655c336 --- /dev/null +++ b/nordic/trezor/radio_test/debug.conf @@ -0,0 +1,17 @@ +# Copyright (c) 2021 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 +# +# This is a Kconfig fragment which can be used to enable debug-related options +# in the application. See the README for more details. + +# compiler +CONFIG_DEBUG_OPTIMIZATIONS=y + +# logging +CONFIG_LOG=y +CONFIG_RTT_CONSOLE=y +CONFIG_USE_SEGGER_RTT=y +CONFIG_LOG_BACKEND_RTT=y + + +CONFIG_ASSERT=y diff --git a/nordic/trezor/radio_test/sysbuild/mcuboot.conf b/nordic/trezor/radio_test/sysbuild/mcuboot.conf index da5fef8c3c..4dfe2a2e2c 100644 --- a/nordic/trezor/radio_test/sysbuild/mcuboot.conf +++ b/nordic/trezor/radio_test/sysbuild/mcuboot.conf @@ -15,6 +15,7 @@ CONFIG_UART_NRFX=y CONFIG_GPIO=y CONFIG_GPIO_NRFX_INTERRUPT=n CONFIG_MCUBOOT_SERIAL=y +CONFIG_BOOT_FIH_PROFILE_MEDIUM=y CONFIG_BOOT_MGMT_ECHO=y CONFIG_BOOT_SERIAL_CDC_ACM=y CONFIG_BOOT_SERIAL_UART=y @@ -27,7 +28,7 @@ CONFIG_MCUBOOT_BOOTLOADER_MODE_SINGLE_APP=y CONFIG_SINGLE_APPLICATION_SLOT=y CONFIG_BOOT_VALIDATE_SLOT0=y -CONFIG_RTT_CONSOLE=y -CONFIG_USE_SEGGER_RTT=y +CONFIG_RTT_CONSOLE=n +CONFIG_USE_SEGGER_RTT=n CONFIG_UART_CONSOLE=n diff --git a/nordic/trezor/radio_test/sysbuild/mcuboot_debug.conf b/nordic/trezor/radio_test/sysbuild/mcuboot_debug.conf new file mode 100644 index 0000000000..67281d5f55 --- /dev/null +++ b/nordic/trezor/radio_test/sysbuild/mcuboot_debug.conf @@ -0,0 +1,11 @@ +# Copyright (c) 2021 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 +# +# This is a Kconfig fragment which can be used to enable debug-related options +# in the application. See the README for more details. + + +# logging +CONFIG_RTT_CONSOLE=y +CONFIG_USE_SEGGER_RTT=y + diff --git a/nordic/trezor/radio_test/sysbuild/mcuboot_prod.conf b/nordic/trezor/radio_test/sysbuild/mcuboot_prod.conf new file mode 100644 index 0000000000..f5bb4b8ea2 --- /dev/null +++ b/nordic/trezor/radio_test/sysbuild/mcuboot_prod.conf @@ -0,0 +1,7 @@ +# Copyright (c) 2021 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 +# +# This is a Kconfig fragment which can be used to enable debug-related options +# in the application. See the README for more details. + +CONFIG_BOOT_PRODUCTION_KEY=y diff --git a/nordic/trezor/trezor-ble/prod.conf b/nordic/trezor/trezor-ble/prod.conf new file mode 100644 index 0000000000..688e860620 --- /dev/null +++ b/nordic/trezor/trezor-ble/prod.conf @@ -0,0 +1,7 @@ +# Copyright (c) 2021 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 +# +# This is a Kconfig fragment which can be used to enable debug-related options +# in the application. See the README for more details. + +CONFIG_NRF_APPROTECT_LOCK=y diff --git a/nordic/trezor/trezor-ble/sysbuild/mcuboot.conf b/nordic/trezor/trezor-ble/sysbuild/mcuboot.conf index da5fef8c3c..69c2f52579 100644 --- a/nordic/trezor/trezor-ble/sysbuild/mcuboot.conf +++ b/nordic/trezor/trezor-ble/sysbuild/mcuboot.conf @@ -27,7 +27,7 @@ CONFIG_MCUBOOT_BOOTLOADER_MODE_SINGLE_APP=y CONFIG_SINGLE_APPLICATION_SLOT=y CONFIG_BOOT_VALIDATE_SLOT0=y -CONFIG_RTT_CONSOLE=y -CONFIG_USE_SEGGER_RTT=y +CONFIG_RTT_CONSOLE=n +CONFIG_USE_SEGGER_RTT=n CONFIG_UART_CONSOLE=n diff --git a/nordic/trezor/trezor-ble/sysbuild/mcuboot_debug.conf b/nordic/trezor/trezor-ble/sysbuild/mcuboot_debug.conf new file mode 100644 index 0000000000..67281d5f55 --- /dev/null +++ b/nordic/trezor/trezor-ble/sysbuild/mcuboot_debug.conf @@ -0,0 +1,11 @@ +# Copyright (c) 2021 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 +# +# This is a Kconfig fragment which can be used to enable debug-related options +# in the application. See the README for more details. + + +# logging +CONFIG_RTT_CONSOLE=y +CONFIG_USE_SEGGER_RTT=y + diff --git a/nordic/trezor/trezor-ble/sysbuild/mcuboot_prod.conf b/nordic/trezor/trezor-ble/sysbuild/mcuboot_prod.conf new file mode 100644 index 0000000000..f5bb4b8ea2 --- /dev/null +++ b/nordic/trezor/trezor-ble/sysbuild/mcuboot_prod.conf @@ -0,0 +1,7 @@ +# Copyright (c) 2021 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 +# +# This is a Kconfig fragment which can be used to enable debug-related options +# in the application. See the README for more details. + +CONFIG_BOOT_PRODUCTION_KEY=y