From ea6d2868f9c2ae1614ec58165917235562e655c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Szczygie=C5=82?= Date: Fri, 26 Sep 2025 07:50:35 +0200 Subject: [PATCH 01/14] samples: hello_world_mini_boot: Add sample MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only hello_world application with as little config as possible. No bootloader added yet. Signed-off-by: Adam Szczygieł --- samples/zephyr/hello_world_mini_boot/CMakeLists.txt | 11 +++++++++++ samples/zephyr/hello_world_mini_boot/prj.conf | 1 + 2 files changed, 12 insertions(+) create mode 100644 samples/zephyr/hello_world_mini_boot/CMakeLists.txt create mode 100644 samples/zephyr/hello_world_mini_boot/prj.conf diff --git a/samples/zephyr/hello_world_mini_boot/CMakeLists.txt b/samples/zephyr/hello_world_mini_boot/CMakeLists.txt new file mode 100644 index 00000000000..d1470a37b89 --- /dev/null +++ b/samples/zephyr/hello_world_mini_boot/CMakeLists.txt @@ -0,0 +1,11 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(hello_world_mini_boot) + +target_sources(app PRIVATE ${ZEPHYR_BASE}/samples/hello_world/src/main.c) diff --git a/samples/zephyr/hello_world_mini_boot/prj.conf b/samples/zephyr/hello_world_mini_boot/prj.conf new file mode 100644 index 00000000000..337dd824690 --- /dev/null +++ b/samples/zephyr/hello_world_mini_boot/prj.conf @@ -0,0 +1 @@ +# NOTE: Config intentionally left empty for maximum simplicity of the sample From dc57a0fc7a2ee478ab2f76f3ec8e15f0276caef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Szczygie=C5=82?= Date: Fri, 26 Sep 2025 08:19:40 +0200 Subject: [PATCH 02/14] samples: hello_world_mini_boot: Add mcuboot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add mcuboot as a bootloader. Provide as simple config as possible. Signed-off-by: Adam Szczygieł --- samples/zephyr/hello_world_mini_boot/sysbuild.conf | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 samples/zephyr/hello_world_mini_boot/sysbuild.conf diff --git a/samples/zephyr/hello_world_mini_boot/sysbuild.conf b/samples/zephyr/hello_world_mini_boot/sysbuild.conf new file mode 100644 index 00000000000..34f887190b3 --- /dev/null +++ b/samples/zephyr/hello_world_mini_boot/sysbuild.conf @@ -0,0 +1,2 @@ +# Enable MCUboot bootloader support +SB_CONFIG_BOOTLOADER_MCUBOOT=y From 55489ab5805d957b3b6376d0fe5e1b4d24f578b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Szczygie=C5=82?= Date: Fri, 26 Sep 2025 14:16:36 +0200 Subject: [PATCH 03/14] Early experiments with local mcuboot config. No app functionality yet. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adam Szczygieł --- .../hello_world_mini_boot/CMakeLists.txt | 2 +- .../sysbuild/mcuboot/prj.conf | 88 +++++++++++++++++++ 2 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf diff --git a/samples/zephyr/hello_world_mini_boot/CMakeLists.txt b/samples/zephyr/hello_world_mini_boot/CMakeLists.txt index d1470a37b89..5cea844b5d9 100644 --- a/samples/zephyr/hello_world_mini_boot/CMakeLists.txt +++ b/samples/zephyr/hello_world_mini_boot/CMakeLists.txt @@ -8,4 +8,4 @@ cmake_minimum_required(VERSION 3.20.0) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(hello_world_mini_boot) -target_sources(app PRIVATE ${ZEPHYR_BASE}/samples/hello_world/src/main.c) +target_sources(app PRIVATE ${ZEPHYR_BASE}/samples/subsys/mgmt/mcumgr/smp_svr/src/main.c) diff --git a/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf b/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf new file mode 100644 index 00000000000..0e01a585f29 --- /dev/null +++ b/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf @@ -0,0 +1,88 @@ +# NOTE: Config below from mcuboot's prj.conf +CONFIG_PM=n + +CONFIG_MAIN_STACK_SIZE=10240 + +CONFIG_BOOT_SWAP_SAVE_ENCTLV=n +CONFIG_BOOT_ENCRYPT_IMAGE=n + +CONFIG_BOOT_UPGRADE_ONLY=n +CONFIG_BOOT_BOOTSTRAP=n + +### mbedTLS has its own heap +# CONFIG_HEAP_MEM_POOL_SIZE is not set + +CONFIG_FLASH=y + +### Various Zephyr boards enable features that we don't want. +# CONFIG_BT is not set +# CONFIG_I2C is not set + +CONFIG_LOG=y +CONFIG_LOG_MODE_MINIMAL=y +### Ensure Zephyr logging changes don't use more resources +CONFIG_LOG_DEFAULT_LEVEL=0 +### Use info log level by default +CONFIG_MCUBOOT_LOG_LEVEL_INF=y +### Decrease footprint by ~4 KB in comparison to CBPRINTF_COMPLETE=y +CONFIG_CBPRINTF_NANO=y +### Use picolibc to reduce flash usage +CONFIG_PICOLIBC=y +### Disable malloc arena because we don't need it +CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=0 + +# NCS boot banner +CONFIG_NCS_APPLICATION_BOOT_BANNER_STRING="MCUboot" + +# NOTE: Config below from mcuboot's soc/nrf54l05_cpuapp.conf + +CONFIG_BOOT_MAX_IMG_SECTORS=256 + +# Ensure that the SPI NOR driver is disabled by default +CONFIG_SPI_NOR=n + +CONFIG_BOOT_WATCHDOG_FEED=n + +# Ensure the fastest RRAM write operations +CONFIG_NRF_RRAM_WRITE_BUFFER_SIZE=32 + +# NOTE: Combining both sections above gives results as default mcuboot config + +# NOTE: Now working on minimal config... + +CONFIG_SIZE_OPTIMIZATIONS=y +CONFIG_MAIN_STACK_SIZE=10240 +CONFIG_BOOT_MAX_IMG_SECTORS=256 +CONFIG_BOOT_BOOTSTRAP=n + +CONFIG_BOOT_VERSION_CMP_USE_BUILD_NUMBER=y + +# CONFIG_FLASH=y # TODO: Already defined above +CONFIG_FPROTECT=y + +# Reduce memory consumption +CONFIG_BOOT_BANNER=n +CONFIG_NCS_BOOT_BANNER=n +CONFIG_CLOCK_CONTROL=n +CONFIG_USE_SEGGER_RTT=n +CONFIG_PRINTK=n +CONFIG_GPIO=n +CONFIG_SPI_NOR=n + +# TODO: Comment-out to enable logs (increases footprint by nnn) +# CONFIG_SERIAL=n +# CONFIG_CONSOLE=n +# CONFIG_UART_CONSOLE=n + +# WARN: Using this prevents app showing logs but saves 0.1 KiB of flash +# CONFIG_NRF_GRTC_START_SYSCOUNTER=n + +# Use minimal C library instead of the Picolib +CONFIG_MINIMAL_LIBC=y + +# Activate Link Time Optimization (LTO) +CONFIG_LTO=y +CONFIG_ISR_TABLES_LOCAL_DECLARATION=y + +# Improve debugging experience by disabling reset on fatal error +CONFIG_RESET_ON_FATAL_ERROR=n From e2e01705ac084bfdb5a2b3c8b50da71343f582a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Szczygie=C5=82?= Date: Fri, 26 Sep 2025 14:52:38 +0200 Subject: [PATCH 04/14] Somehow working update using uart MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adam Szczygieł --- samples/zephyr/hello_world_mini_boot/prj.conf | 92 ++++++++++++++++++- .../sysbuild/mcuboot/prj.conf | 2 + 2 files changed, 93 insertions(+), 1 deletion(-) diff --git a/samples/zephyr/hello_world_mini_boot/prj.conf b/samples/zephyr/hello_world_mini_boot/prj.conf index 337dd824690..55d9cf61fe7 100644 --- a/samples/zephyr/hello_world_mini_boot/prj.conf +++ b/samples/zephyr/hello_world_mini_boot/prj.conf @@ -1 +1,91 @@ -# NOTE: Config intentionally left empty for maximum simplicity of the sample +# NOTE: Copied from smp_svr_minig_boot - exceeds flash size... + +# Enable MCUmgr and dependencies. +CONFIG_NET_BUF=y +CONFIG_ZCBOR=y +CONFIG_CRC=y +CONFIG_MCUMGR=y +CONFIG_STREAM_FLASH=y +CONFIG_FLASH_MAP=y + +# Some command handlers require a large stack. +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2304 +CONFIG_MAIN_STACK_SIZE=2176 + +# Ensure an MCUboot-compatible binary is generated. +CONFIG_BOOTLOADER_MCUBOOT=y + +# Enable flash operations. +CONFIG_FLASH=y + +# Required by the `taskstat` command. +CONFIG_THREAD_MONITOR=y + +# Support for taskstat command +CONFIG_MCUMGR_GRP_OS_TASKSTAT=y + +# Enable statistics and statistic names. +CONFIG_STATS=y +CONFIG_STATS_NAMES=y + +# Enable most core commands. +CONFIG_FLASH=y +CONFIG_IMG_MANAGER=y +CONFIG_MCUMGR_GRP_IMG=y +CONFIG_MCUMGR_GRP_OS=y +CONFIG_MCUMGR_GRP_STAT=y + +# Enable logging +CONFIG_LOG=y +CONFIG_MCUBOOT_UTIL_LOG_LEVEL_WRN=y + +# Disable debug logging +CONFIG_LOG_MAX_LEVEL=3 + +# CONFIG_BT=y +# CONFIG_BT_PERIPHERAL=y + +# Allow for large Bluetooth data packets. +# CONFIG_BT_L2CAP_TX_MTU=247 +# CONFIG_BT_BUF_ACL_RX_SIZE=251 +# CONFIG_BT_BUF_ACL_TX_SIZE=251 +# CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 + +# Enable the Bluetooth mcumgr transport (unauthenticated). +# CONFIG_MCUMGR_TRANSPORT_BT=y +# CONFIG_MCUMGR_TRANSPORT_BT_CONN_PARAM_CONTROL=y + +# Enable the Shell mcumgr transport. +CONFIG_BASE64=y +CONFIG_CRC=y +CONFIG_SHELL=y +CONFIG_SHELL_BACKEND_SERIAL=y +CONFIG_MCUMGR_TRANSPORT_SHELL=y + +# Enable the mcumgr Packet Reassembly feature over Bluetooth and its configuration dependencies. +# MCUmgr buffer size is optimized to fit one SMP packet divided into five Bluetooth Write Commands, +# transmitted with the maximum possible MTU value: 247 bytes. +# CONFIG_MCUMGR_TRANSPORT_BT_REASSEMBLY=y +CONFIG_MCUMGR_TRANSPORT_NETBUF_SIZE=1220 +CONFIG_MCUMGR_GRP_OS_MCUMGR_PARAMS=y +CONFIG_MCUMGR_TRANSPORT_WORKQUEUE_STACK_SIZE=4608 + +# Enable the LittleFS file system. +CONFIG_FILE_SYSTEM=y +CONFIG_FILE_SYSTEM_LITTLEFS=y + +# Enable file system commands +CONFIG_MCUMGR_GRP_FS=y + +# Enable the storage erase command. +CONFIG_MCUMGR_GRP_ZBASIC=y +CONFIG_MCUMGR_GRP_ZBASIC_STORAGE_ERASE=y + +# Disable Bluetooth ping support +# CONFIG_BT_CTLR_LE_PING=n + +# Disable shell commands that are not needed +CONFIG_CLOCK_CONTROL_NRF_SHELL=n +CONFIG_DEVICE_SHELL=n +CONFIG_DEVMEM_SHELL=n +CONFIG_FLASH_SHELL=n diff --git a/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf b/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf index 0e01a585f29..35cdf920db9 100644 --- a/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf +++ b/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf @@ -50,6 +50,8 @@ CONFIG_NRF_RRAM_WRITE_BUFFER_SIZE=32 # NOTE: Now working on minimal config... +# NOTE: Section below is from smp_svr_minig_boot + CONFIG_SIZE_OPTIMIZATIONS=y CONFIG_MAIN_STACK_SIZE=10240 CONFIG_BOOT_MAX_IMG_SECTORS=256 From 06296dba20c8f1fe4953f3c9715df2f0b62eebb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Szczygie=C5=82?= Date: Fri, 26 Sep 2025 15:05:33 +0200 Subject: [PATCH 05/14] Seems to work with these simplifications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adam Szczygieł --- samples/zephyr/hello_world_mini_boot/prj.conf | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/samples/zephyr/hello_world_mini_boot/prj.conf b/samples/zephyr/hello_world_mini_boot/prj.conf index 55d9cf61fe7..135e6ca7437 100644 --- a/samples/zephyr/hello_world_mini_boot/prj.conf +++ b/samples/zephyr/hello_world_mini_boot/prj.conf @@ -19,17 +19,16 @@ CONFIG_BOOTLOADER_MCUBOOT=y CONFIG_FLASH=y # Required by the `taskstat` command. -CONFIG_THREAD_MONITOR=y +# CONFIG_THREAD_MONITOR=y # Support for taskstat command -CONFIG_MCUMGR_GRP_OS_TASKSTAT=y +# CONFIG_MCUMGR_GRP_OS_TASKSTAT=y # Enable statistics and statistic names. -CONFIG_STATS=y -CONFIG_STATS_NAMES=y +# CONFIG_STATS=y +# CONFIG_STATS_NAMES=y # Enable most core commands. -CONFIG_FLASH=y CONFIG_IMG_MANAGER=y CONFIG_MCUMGR_GRP_IMG=y CONFIG_MCUMGR_GRP_OS=y @@ -71,15 +70,15 @@ CONFIG_MCUMGR_GRP_OS_MCUMGR_PARAMS=y CONFIG_MCUMGR_TRANSPORT_WORKQUEUE_STACK_SIZE=4608 # Enable the LittleFS file system. -CONFIG_FILE_SYSTEM=y -CONFIG_FILE_SYSTEM_LITTLEFS=y +# CONFIG_FILE_SYSTEM=y +# CONFIG_FILE_SYSTEM_LITTLEFS=y # Enable file system commands -CONFIG_MCUMGR_GRP_FS=y +# CONFIG_MCUMGR_GRP_FS=y # Enable the storage erase command. -CONFIG_MCUMGR_GRP_ZBASIC=y -CONFIG_MCUMGR_GRP_ZBASIC_STORAGE_ERASE=y +# CONFIG_MCUMGR_GRP_ZBASIC=y +# CONFIG_MCUMGR_GRP_ZBASIC_STORAGE_ERASE=y # Disable Bluetooth ping support # CONFIG_BT_CTLR_LE_PING=n From 28760b9eb5770e8236104294dfe642be6c51dbb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Szczygie=C5=82?= Date: Mon, 29 Sep 2025 11:00:59 +0200 Subject: [PATCH 06/14] Remove commented-out configs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adam Szczygieł --- samples/zephyr/hello_world_mini_boot/prj.conf | 41 ------------------- .../sysbuild/mcuboot/prj.conf | 8 ---- 2 files changed, 49 deletions(-) diff --git a/samples/zephyr/hello_world_mini_boot/prj.conf b/samples/zephyr/hello_world_mini_boot/prj.conf index 135e6ca7437..18c2443801e 100644 --- a/samples/zephyr/hello_world_mini_boot/prj.conf +++ b/samples/zephyr/hello_world_mini_boot/prj.conf @@ -18,16 +18,6 @@ CONFIG_BOOTLOADER_MCUBOOT=y # Enable flash operations. CONFIG_FLASH=y -# Required by the `taskstat` command. -# CONFIG_THREAD_MONITOR=y - -# Support for taskstat command -# CONFIG_MCUMGR_GRP_OS_TASKSTAT=y - -# Enable statistics and statistic names. -# CONFIG_STATS=y -# CONFIG_STATS_NAMES=y - # Enable most core commands. CONFIG_IMG_MANAGER=y CONFIG_MCUMGR_GRP_IMG=y @@ -41,19 +31,6 @@ CONFIG_MCUBOOT_UTIL_LOG_LEVEL_WRN=y # Disable debug logging CONFIG_LOG_MAX_LEVEL=3 -# CONFIG_BT=y -# CONFIG_BT_PERIPHERAL=y - -# Allow for large Bluetooth data packets. -# CONFIG_BT_L2CAP_TX_MTU=247 -# CONFIG_BT_BUF_ACL_RX_SIZE=251 -# CONFIG_BT_BUF_ACL_TX_SIZE=251 -# CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 - -# Enable the Bluetooth mcumgr transport (unauthenticated). -# CONFIG_MCUMGR_TRANSPORT_BT=y -# CONFIG_MCUMGR_TRANSPORT_BT_CONN_PARAM_CONTROL=y - # Enable the Shell mcumgr transport. CONFIG_BASE64=y CONFIG_CRC=y @@ -61,28 +38,10 @@ CONFIG_SHELL=y CONFIG_SHELL_BACKEND_SERIAL=y CONFIG_MCUMGR_TRANSPORT_SHELL=y -# Enable the mcumgr Packet Reassembly feature over Bluetooth and its configuration dependencies. -# MCUmgr buffer size is optimized to fit one SMP packet divided into five Bluetooth Write Commands, -# transmitted with the maximum possible MTU value: 247 bytes. -# CONFIG_MCUMGR_TRANSPORT_BT_REASSEMBLY=y CONFIG_MCUMGR_TRANSPORT_NETBUF_SIZE=1220 CONFIG_MCUMGR_GRP_OS_MCUMGR_PARAMS=y CONFIG_MCUMGR_TRANSPORT_WORKQUEUE_STACK_SIZE=4608 -# Enable the LittleFS file system. -# CONFIG_FILE_SYSTEM=y -# CONFIG_FILE_SYSTEM_LITTLEFS=y - -# Enable file system commands -# CONFIG_MCUMGR_GRP_FS=y - -# Enable the storage erase command. -# CONFIG_MCUMGR_GRP_ZBASIC=y -# CONFIG_MCUMGR_GRP_ZBASIC_STORAGE_ERASE=y - -# Disable Bluetooth ping support -# CONFIG_BT_CTLR_LE_PING=n - # Disable shell commands that are not needed CONFIG_CLOCK_CONTROL_NRF_SHELL=n CONFIG_DEVICE_SHELL=n diff --git a/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf b/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf index 35cdf920db9..e732b68643c 100644 --- a/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf +++ b/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf @@ -9,15 +9,8 @@ CONFIG_BOOT_ENCRYPT_IMAGE=n CONFIG_BOOT_UPGRADE_ONLY=n CONFIG_BOOT_BOOTSTRAP=n -### mbedTLS has its own heap -# CONFIG_HEAP_MEM_POOL_SIZE is not set - CONFIG_FLASH=y -### Various Zephyr boards enable features that we don't want. -# CONFIG_BT is not set -# CONFIG_I2C is not set - CONFIG_LOG=y CONFIG_LOG_MODE_MINIMAL=y ### Ensure Zephyr logging changes don't use more resources @@ -59,7 +52,6 @@ CONFIG_BOOT_BOOTSTRAP=n CONFIG_BOOT_VERSION_CMP_USE_BUILD_NUMBER=y -# CONFIG_FLASH=y # TODO: Already defined above CONFIG_FPROTECT=y # Reduce memory consumption From e45caad408d87d478f285093642dcd0bea9c599a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Szczygie=C5=82?= Date: Mon, 6 Oct 2025 14:42:31 +0200 Subject: [PATCH 07/14] WIP - switching to nrf_oberon, disabling logs, etc. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adam Szczygieł --- .../boards/nrf54l15dk_nrf54l05_cpuapp.conf | 23 ++++++++++++++++ .../sysbuild/mcuboot/prj.conf | 26 +++++++++---------- 2 files changed, 36 insertions(+), 13 deletions(-) create mode 100644 samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/boards/nrf54l15dk_nrf54l05_cpuapp.conf diff --git a/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/boards/nrf54l15dk_nrf54l05_cpuapp.conf b/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/boards/nrf54l15dk_nrf54l05_cpuapp.conf new file mode 100644 index 00000000000..66b41b23d6c --- /dev/null +++ b/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/boards/nrf54l15dk_nrf54l05_cpuapp.conf @@ -0,0 +1,23 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_SYS_CLOCK_EXISTS=n # \ These save about 2 KiB +CONFIG_NRF_GRTC_TIMER=n # / + +# CONFIG_PSA_CORE_LITE=y # \ These don't build +# CONFIG_PSA_CORE_LITE_NSIB_ED25519_OPTIMIZATIONS=y # / + +# CONFIG_CRACEN_IKG=n # No effect on size nor behavior + +# Disable run-time CRACEN provisioning of TRNG data. +# KMU slots 248, 249 shall be pre-provisioned while programming with secret TRNG values instead. +#CONFIG_CRACEN_PROVISION_PROT_RAM_INV_DATA=n # No effect on size nor behavior + +# NOTE: 20251006 +CONFIG_PSA_CRYPTO_DRIVER_CRACEN=n +CONFIG_PSA_CRYPTO_DRIVER_OBERON=y + +# NOTE: Does not influence binary size; it is not mentioned in docs - what is its purpose? +CONFIG_NRF_OBERON=y diff --git a/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf b/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf index e732b68643c..048674ccbdb 100644 --- a/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf +++ b/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf @@ -11,21 +11,21 @@ CONFIG_BOOT_BOOTSTRAP=n CONFIG_FLASH=y -CONFIG_LOG=y -CONFIG_LOG_MODE_MINIMAL=y +# CONFIG_LOG=y +# CONFIG_LOG_MODE_MINIMAL=y ### Ensure Zephyr logging changes don't use more resources -CONFIG_LOG_DEFAULT_LEVEL=0 +# CONFIG_LOG_DEFAULT_LEVEL=0 ### Use info log level by default -CONFIG_MCUBOOT_LOG_LEVEL_INF=y +# CONFIG_MCUBOOT_LOG_LEVEL_INF=y ### Decrease footprint by ~4 KB in comparison to CBPRINTF_COMPLETE=y -CONFIG_CBPRINTF_NANO=y +# CONFIG_CBPRINTF_NANO=y # NOTE: No effect ### Use picolibc to reduce flash usage -CONFIG_PICOLIBC=y +# CONFIG_PICOLIBC=y # NOTE: No effect ### Disable malloc arena because we don't need it -CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=0 +# CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=0 # NOTE: No effect # NCS boot banner -CONFIG_NCS_APPLICATION_BOOT_BANNER_STRING="MCUboot" +# CONFIG_NCS_APPLICATION_BOOT_BANNER_STRING="MCUboot" # NOTE: Config below from mcuboot's soc/nrf54l05_cpuapp.conf @@ -43,7 +43,7 @@ CONFIG_NRF_RRAM_WRITE_BUFFER_SIZE=32 # NOTE: Now working on minimal config... -# NOTE: Section below is from smp_svr_minig_boot +# NOTE: Section below is from smp_svr_mini_boot CONFIG_SIZE_OPTIMIZATIONS=y CONFIG_MAIN_STACK_SIZE=10240 @@ -63,10 +63,10 @@ CONFIG_PRINTK=n CONFIG_GPIO=n CONFIG_SPI_NOR=n -# TODO: Comment-out to enable logs (increases footprint by nnn) -# CONFIG_SERIAL=n -# CONFIG_CONSOLE=n -# CONFIG_UART_CONSOLE=n +# TODO: Comment-out to enable logs (increases footprint by ~ 1KiB) +CONFIG_SERIAL=n +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n # WARN: Using this prevents app showing logs but saves 0.1 KiB of flash # CONFIG_NRF_GRTC_START_SYSCOUNTER=n From df7d1f4c9214b75716b7ec056459641a81c42288 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Szczygie=C5=82?= Date: Tue, 7 Oct 2025 07:50:49 +0200 Subject: [PATCH 08/14] Cleanup of commented-out settings etc. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adam Szczygieł --- samples/zephyr/hello_world_mini_boot/prj.conf | 2 +- .../mcuboot/boards/nrf54l15dk_nrf54l05_cpuapp.conf | 14 +++----------- .../sysbuild/mcuboot/prj.conf | 10 ---------- 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/samples/zephyr/hello_world_mini_boot/prj.conf b/samples/zephyr/hello_world_mini_boot/prj.conf index 18c2443801e..2a250e4f807 100644 --- a/samples/zephyr/hello_world_mini_boot/prj.conf +++ b/samples/zephyr/hello_world_mini_boot/prj.conf @@ -1,4 +1,4 @@ -# NOTE: Copied from smp_svr_minig_boot - exceeds flash size... +# NOTE: Copied from smp_svr_mini_boot # Enable MCUmgr and dependencies. CONFIG_NET_BUF=y diff --git a/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/boards/nrf54l15dk_nrf54l05_cpuapp.conf b/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/boards/nrf54l15dk_nrf54l05_cpuapp.conf index 66b41b23d6c..3828d0dc850 100644 --- a/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/boards/nrf54l15dk_nrf54l05_cpuapp.conf +++ b/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/boards/nrf54l15dk_nrf54l05_cpuapp.conf @@ -3,19 +3,11 @@ # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -CONFIG_SYS_CLOCK_EXISTS=n # \ These save about 2 KiB -CONFIG_NRF_GRTC_TIMER=n # / -# CONFIG_PSA_CORE_LITE=y # \ These don't build -# CONFIG_PSA_CORE_LITE_NSIB_ED25519_OPTIMIZATIONS=y # / +# NOTE: These save about 2 KiB +CONFIG_SYS_CLOCK_EXISTS=n +CONFIG_NRF_GRTC_TIMER=n -# CONFIG_CRACEN_IKG=n # No effect on size nor behavior - -# Disable run-time CRACEN provisioning of TRNG data. -# KMU slots 248, 249 shall be pre-provisioned while programming with secret TRNG values instead. -#CONFIG_CRACEN_PROVISION_PROT_RAM_INV_DATA=n # No effect on size nor behavior - -# NOTE: 20251006 CONFIG_PSA_CRYPTO_DRIVER_CRACEN=n CONFIG_PSA_CRYPTO_DRIVER_OBERON=y diff --git a/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf b/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf index 048674ccbdb..df0437bf53a 100644 --- a/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf +++ b/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf @@ -13,18 +13,8 @@ CONFIG_FLASH=y # CONFIG_LOG=y # CONFIG_LOG_MODE_MINIMAL=y -### Ensure Zephyr logging changes don't use more resources # CONFIG_LOG_DEFAULT_LEVEL=0 -### Use info log level by default # CONFIG_MCUBOOT_LOG_LEVEL_INF=y -### Decrease footprint by ~4 KB in comparison to CBPRINTF_COMPLETE=y -# CONFIG_CBPRINTF_NANO=y # NOTE: No effect -### Use picolibc to reduce flash usage -# CONFIG_PICOLIBC=y # NOTE: No effect -### Disable malloc arena because we don't need it -# CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=0 # NOTE: No effect - -# NCS boot banner # CONFIG_NCS_APPLICATION_BOOT_BANNER_STRING="MCUboot" # NOTE: Config below from mcuboot's soc/nrf54l05_cpuapp.conf From 62a7bbeadf769d8fe552fe765b27a92b3ed3b2b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Szczygie=C5=82?= Date: Tue, 7 Oct 2025 11:24:48 +0200 Subject: [PATCH 09/14] Another early tune-up MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adam Szczygieł --- .../boards/nrf54l15dk_nrf54l05_cpuapp.conf | 15 --- .../sysbuild/mcuboot/prj.conf | 100 +++++++++++++----- 2 files changed, 75 insertions(+), 40 deletions(-) delete mode 100644 samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/boards/nrf54l15dk_nrf54l05_cpuapp.conf diff --git a/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/boards/nrf54l15dk_nrf54l05_cpuapp.conf b/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/boards/nrf54l15dk_nrf54l05_cpuapp.conf deleted file mode 100644 index 3828d0dc850..00000000000 --- a/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/boards/nrf54l15dk_nrf54l05_cpuapp.conf +++ /dev/null @@ -1,15 +0,0 @@ -# -# Copyright (c) 2025 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# NOTE: These save about 2 KiB -CONFIG_SYS_CLOCK_EXISTS=n -CONFIG_NRF_GRTC_TIMER=n - -CONFIG_PSA_CRYPTO_DRIVER_CRACEN=n -CONFIG_PSA_CRYPTO_DRIVER_OBERON=y - -# NOTE: Does not influence binary size; it is not mentioned in docs - what is its purpose? -CONFIG_NRF_OBERON=y diff --git a/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf b/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf index df0437bf53a..13f3ed8e7d8 100644 --- a/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf +++ b/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf @@ -1,33 +1,54 @@ # NOTE: Config below from mcuboot's prj.conf -CONFIG_PM=n +# NOTE: This has no direct influence on binary size. +# Logs about missing pm_static.yml is present in both cases. +# CONFIG_PM=n + +# NOTE: No direct impact on binary size. +# Default stack size is 10 times smaller, 1024B +# Reducing it to default size causes no app logs to be visible CONFIG_MAIN_STACK_SIZE=10240 -CONFIG_BOOT_SWAP_SAVE_ENCTLV=n -CONFIG_BOOT_ENCRYPT_IMAGE=n +# NOTE: No direct impact on binary size. +# Device boots ok. +# CONFIG_BOOT_SWAP_SAVE_ENCTLV=n +# CONFIG_BOOT_ENCRYPT_IMAGE=n -CONFIG_BOOT_UPGRADE_ONLY=n -CONFIG_BOOT_BOOTSTRAP=n +# NOTE: No direct impact on binary size. +# Device boots ok. +# CONFIG_BOOT_UPGRADE_ONLY=n +# CONFIG_BOOT_BOOTSTRAP=n CONFIG_FLASH=y +# TODO: Uncomment to enable mcuboot logs # CONFIG_LOG=y # CONFIG_LOG_MODE_MINIMAL=y # CONFIG_LOG_DEFAULT_LEVEL=0 # CONFIG_MCUBOOT_LOG_LEVEL_INF=y -# CONFIG_NCS_APPLICATION_BOOT_BANNER_STRING="MCUboot" +# TODO: Comment-out to enable mcuboot logs (increases footprint by ~ 1KiB) +CONFIG_SERIAL=n +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n # NOTE: Config below from mcuboot's soc/nrf54l05_cpuapp.conf -CONFIG_BOOT_MAX_IMG_SECTORS=256 +# NOTE: No direct impact on binary size. +# Device boots ok. +# The value is 256 anyway. +# CONFIG_BOOT_MAX_IMG_SECTORS=256 # Ensure that the SPI NOR driver is disabled by default CONFIG_SPI_NOR=n +# NOTE: Having this reduces binary size by 256B CONFIG_BOOT_WATCHDOG_FEED=n # Ensure the fastest RRAM write operations -CONFIG_NRF_RRAM_WRITE_BUFFER_SIZE=32 +# NOTE: Default value is 1. +# Setting it to 32 increases binary size by 8B. +# According to the comment above, RRAM write speed might decrease without it. +# CONFIG_NRF_RRAM_WRITE_BUFFER_SIZE=32 # NOTE: Combining both sections above gives results as default mcuboot config @@ -35,38 +56,67 @@ CONFIG_NRF_RRAM_WRITE_BUFFER_SIZE=32 # NOTE: Section below is from smp_svr_mini_boot +# NOTE: No direct impact on binary size, as the option is set to y anyway. +# However considering the purpose of the minimal config, it might be worth to set it explicitly. +# Device boots ok. CONFIG_SIZE_OPTIMIZATIONS=y -CONFIG_MAIN_STACK_SIZE=10240 -CONFIG_BOOT_MAX_IMG_SECTORS=256 -CONFIG_BOOT_BOOTSTRAP=n -CONFIG_BOOT_VERSION_CMP_USE_BUILD_NUMBER=y +# NOTE: Default value is 128. Setting it to 256 increases binary size by 8B. +# Device boots ok. +# CONFIG_BOOT_MAX_IMG_SECTORS=256 + +# NOTE: No effect, the value is not set by default +# CONFIG_BOOT_BOOTSTRAP=n -CONFIG_FPROTECT=y +# TODO: Remove, this even doesn't get into the final .config +# When commenting out, no impact on size, device boots ok. +# CONFIG_BOOT_VERSION_CMP_USE_BUILD_NUMBER=y -# Reduce memory consumption +# NOTE: Seems to be set to y be default somewhere else. +# Hence disabling it here has no effect. +# CONFIG_FPROTECT=y + +# NOTE: This decreases binary size by 4600B CONFIG_BOOT_BANNER=n + +# NOTE: This decreases binary size by 4640B (or just 40B in conjunction with CONFIG_BOOT_BANNEDR?) CONFIG_NCS_BOOT_BANNER=n -CONFIG_CLOCK_CONTROL=n -CONFIG_USE_SEGGER_RTT=n + +# TODO: Remove, as it seems to be set to n somwehere else. No impact. +# CONFIG_CLOCK_CONTROL=n + +# TODO: Remove, as it seems to be set to n somwehere else. No impact. +# CONFIG_USE_SEGGER_RTT=n + +# NOTE: This decreases binary size by 4456B CONFIG_PRINTK=n -CONFIG_GPIO=n -CONFIG_SPI_NOR=n -# TODO: Comment-out to enable logs (increases footprint by ~ 1KiB) -CONFIG_SERIAL=n -CONFIG_CONSOLE=n -CONFIG_UART_CONSOLE=n +# NOTE: This decreases binary size by 3580B +CONFIG_GPIO=n # WARN: Using this prevents app showing logs but saves 0.1 KiB of flash +# NOTE: When logs are disabled, uncommenting this has no influence on size and app logs correctly # CONFIG_NRF_GRTC_START_SYSCOUNTER=n -# Use minimal C library instead of the Picolib +# NOTE: Decreases binary size by 888B CONFIG_MINIMAL_LIBC=y -# Activate Link Time Optimization (LTO) +# NOTE: Decreases binary size by 6132B CONFIG_LTO=y + +# NOTE: Decreases binary size by 6132B CONFIG_ISR_TABLES_LOCAL_DECLARATION=y # Improve debugging experience by disabling reset on fatal error -CONFIG_RESET_ON_FATAL_ERROR=n +# TODO: Remove, as it seems to be set to n somwehere else. No impact. +# CONFIG_RESET_ON_FATAL_ERROR=n + +# NOTE: Configs below were originally in boards/nrf54l15dk_nrf54l05_cpuapp.conf +# Moved here for simpler structure, as the sample is intended only for l05 for now. + +# NOTE: These save about 2 KiB +CONFIG_SYS_CLOCK_EXISTS=n +CONFIG_NRF_GRTC_TIMER=n + +CONFIG_PSA_CRYPTO_DRIVER_CRACEN=n +CONFIG_PSA_CRYPTO_DRIVER_OBERON=y From de9844cdc9352771727e4970d45ef64224cab8e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Szczygie=C5=82?= Date: Tue, 7 Oct 2025 11:58:17 +0200 Subject: [PATCH 10/14] Remove configs that do not affect binary size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adam Szczygieł --- .../sysbuild/mcuboot/prj.conf | 74 +------------------ 1 file changed, 4 insertions(+), 70 deletions(-) diff --git a/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf b/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf index 13f3ed8e7d8..ca4ddc4c79e 100644 --- a/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf +++ b/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf @@ -1,24 +1,7 @@ -# NOTE: Config below from mcuboot's prj.conf +# INFO: Config below from mcuboot's prj.conf -# NOTE: This has no direct influence on binary size. -# Logs about missing pm_static.yml is present in both cases. -# CONFIG_PM=n - -# NOTE: No direct impact on binary size. -# Default stack size is 10 times smaller, 1024B -# Reducing it to default size causes no app logs to be visible CONFIG_MAIN_STACK_SIZE=10240 -# NOTE: No direct impact on binary size. -# Device boots ok. -# CONFIG_BOOT_SWAP_SAVE_ENCTLV=n -# CONFIG_BOOT_ENCRYPT_IMAGE=n - -# NOTE: No direct impact on binary size. -# Device boots ok. -# CONFIG_BOOT_UPGRADE_ONLY=n -# CONFIG_BOOT_BOOTSTRAP=n - CONFIG_FLASH=y # TODO: Uncomment to enable mcuboot logs @@ -31,17 +14,10 @@ CONFIG_SERIAL=n CONFIG_CONSOLE=n CONFIG_UART_CONSOLE=n -# NOTE: Config below from mcuboot's soc/nrf54l05_cpuapp.conf +# INFO: Config below from mcuboot's soc/nrf54l05_cpuapp.conf -# NOTE: No direct impact on binary size. -# Device boots ok. -# The value is 256 anyway. -# CONFIG_BOOT_MAX_IMG_SECTORS=256 - -# Ensure that the SPI NOR driver is disabled by default CONFIG_SPI_NOR=n -# NOTE: Having this reduces binary size by 256B CONFIG_BOOT_WATCHDOG_FEED=n # Ensure the fastest RRAM write operations @@ -50,71 +26,29 @@ CONFIG_BOOT_WATCHDOG_FEED=n # According to the comment above, RRAM write speed might decrease without it. # CONFIG_NRF_RRAM_WRITE_BUFFER_SIZE=32 -# NOTE: Combining both sections above gives results as default mcuboot config - -# NOTE: Now working on minimal config... -# NOTE: Section below is from smp_svr_mini_boot +# INFO: Section below is from smp_svr_mini_boot # NOTE: No direct impact on binary size, as the option is set to y anyway. # However considering the purpose of the minimal config, it might be worth to set it explicitly. -# Device boots ok. CONFIG_SIZE_OPTIMIZATIONS=y -# NOTE: Default value is 128. Setting it to 256 increases binary size by 8B. -# Device boots ok. -# CONFIG_BOOT_MAX_IMG_SECTORS=256 - -# NOTE: No effect, the value is not set by default -# CONFIG_BOOT_BOOTSTRAP=n - -# TODO: Remove, this even doesn't get into the final .config -# When commenting out, no impact on size, device boots ok. -# CONFIG_BOOT_VERSION_CMP_USE_BUILD_NUMBER=y - -# NOTE: Seems to be set to y be default somewhere else. -# Hence disabling it here has no effect. -# CONFIG_FPROTECT=y - -# NOTE: This decreases binary size by 4600B CONFIG_BOOT_BANNER=n - -# NOTE: This decreases binary size by 4640B (or just 40B in conjunction with CONFIG_BOOT_BANNEDR?) CONFIG_NCS_BOOT_BANNER=n - -# TODO: Remove, as it seems to be set to n somwehere else. No impact. -# CONFIG_CLOCK_CONTROL=n - -# TODO: Remove, as it seems to be set to n somwehere else. No impact. -# CONFIG_USE_SEGGER_RTT=n - -# NOTE: This decreases binary size by 4456B CONFIG_PRINTK=n - -# NOTE: This decreases binary size by 3580B CONFIG_GPIO=n # WARN: Using this prevents app showing logs but saves 0.1 KiB of flash # NOTE: When logs are disabled, uncommenting this has no influence on size and app logs correctly # CONFIG_NRF_GRTC_START_SYSCOUNTER=n -# NOTE: Decreases binary size by 888B CONFIG_MINIMAL_LIBC=y - -# NOTE: Decreases binary size by 6132B CONFIG_LTO=y - -# NOTE: Decreases binary size by 6132B CONFIG_ISR_TABLES_LOCAL_DECLARATION=y -# Improve debugging experience by disabling reset on fatal error -# TODO: Remove, as it seems to be set to n somwehere else. No impact. -# CONFIG_RESET_ON_FATAL_ERROR=n - -# NOTE: Configs below were originally in boards/nrf54l15dk_nrf54l05_cpuapp.conf +# INFO: Configs below were originally in boards/nrf54l15dk_nrf54l05_cpuapp.conf # Moved here for simpler structure, as the sample is intended only for l05 for now. -# NOTE: These save about 2 KiB CONFIG_SYS_CLOCK_EXISTS=n CONFIG_NRF_GRTC_TIMER=n From 1c3ef6f0aa9d49d09fff423bf1cfe4099a270059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Szczygie=C5=82?= Date: Fri, 17 Oct 2025 15:21:09 +0200 Subject: [PATCH 11/14] WIP - Add configs for ocrypto and logs for debugging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At the moment mcuboot builds with ocrypto_ (nrf_oberon) but app image verification at boot fails - TBD. Signed-off-by: Adam Szczygieł --- .../hello_world_mini_boot/sysbuild.conf | 1 + .../sysbuild/mcuboot/prj.conf | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/samples/zephyr/hello_world_mini_boot/sysbuild.conf b/samples/zephyr/hello_world_mini_boot/sysbuild.conf index 34f887190b3..2276f176bb3 100644 --- a/samples/zephyr/hello_world_mini_boot/sysbuild.conf +++ b/samples/zephyr/hello_world_mini_boot/sysbuild.conf @@ -1,2 +1,3 @@ # Enable MCUboot bootloader support SB_CONFIG_BOOTLOADER_MCUBOOT=y +SB_CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256=y diff --git a/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf b/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf index ca4ddc4c79e..fe13607950b 100644 --- a/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf +++ b/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf @@ -5,14 +5,14 @@ CONFIG_MAIN_STACK_SIZE=10240 CONFIG_FLASH=y # TODO: Uncomment to enable mcuboot logs -# CONFIG_LOG=y -# CONFIG_LOG_MODE_MINIMAL=y -# CONFIG_LOG_DEFAULT_LEVEL=0 -# CONFIG_MCUBOOT_LOG_LEVEL_INF=y +CONFIG_LOG=y +CONFIG_LOG_MODE_MINIMAL=y +CONFIG_LOG_DEFAULT_LEVEL=0 +CONFIG_MCUBOOT_LOG_LEVEL_INF=y # TODO: Comment-out to enable mcuboot logs (increases footprint by ~ 1KiB) -CONFIG_SERIAL=n -CONFIG_CONSOLE=n -CONFIG_UART_CONSOLE=n +# CONFIG_SERIAL=n +# CONFIG_CONSOLE=n +# CONFIG_UART_CONSOLE=n # INFO: Config below from mcuboot's soc/nrf54l05_cpuapp.conf @@ -53,4 +53,7 @@ CONFIG_SYS_CLOCK_EXISTS=n CONFIG_NRF_GRTC_TIMER=n CONFIG_PSA_CRYPTO_DRIVER_CRACEN=n -CONFIG_PSA_CRYPTO_DRIVER_OBERON=y +CONFIG_PSA_CRYPTO_DRIVER_OBERON=n + +CONFIG_NRF_OBERON=y +CONFIG_BOOT_ECDSA_NRF_OBERON_EXPERIMENT=y From c28bafb82af0f8c84da482cd56aedeb4d9404151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Szczygie=C5=82?= Date: Tue, 21 Oct 2025 14:00:37 +0200 Subject: [PATCH 12/14] Disable mcuboot logs to limit memory footprint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adam Szczygieł --- .../sysbuild/mcuboot/prj.conf | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf b/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf index fe13607950b..e0410ea2f98 100644 --- a/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf +++ b/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf @@ -5,14 +5,14 @@ CONFIG_MAIN_STACK_SIZE=10240 CONFIG_FLASH=y # TODO: Uncomment to enable mcuboot logs -CONFIG_LOG=y -CONFIG_LOG_MODE_MINIMAL=y -CONFIG_LOG_DEFAULT_LEVEL=0 -CONFIG_MCUBOOT_LOG_LEVEL_INF=y +# CONFIG_LOG=y +# CONFIG_LOG_MODE_MINIMAL=y +# CONFIG_LOG_DEFAULT_LEVEL=0 +# CONFIG_MCUBOOT_LOG_LEVEL_DBG=y # TODO: Comment-out to enable mcuboot logs (increases footprint by ~ 1KiB) -# CONFIG_SERIAL=n -# CONFIG_CONSOLE=n -# CONFIG_UART_CONSOLE=n +CONFIG_SERIAL=n +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n # INFO: Config below from mcuboot's soc/nrf54l05_cpuapp.conf From 879634b6ed535faab97e361eea346918ef62f4f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Szczygie=C5=82?= Date: Wed, 22 Oct 2025 07:54:10 +0200 Subject: [PATCH 13/14] Add mcuboot dependency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adam Szczygieł --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index bc409a25b4f..58bc7803114 100644 --- a/west.yml +++ b/west.yml @@ -126,7 +126,7 @@ manifest: compare-by-default: true - name: mcuboot repo-path: sdk-mcuboot - revision: 459288d6a13cede9fa09e314b21a979a6cc6e3f2 + revision: pull/559/head path: bootloader/mcuboot - name: qcbor url: https://github.com/laurencelundblade/QCBOR From da62218a772dbe4c05e795341391c5e84d1c8bfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Szczygie=C5=82?= Date: Thu, 23 Oct 2025 08:45:18 +0200 Subject: [PATCH 14/14] Experimental setup for direct-xip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adam Szczygieł --- samples/zephyr/hello_world_mini_boot/VERSION | 5 +++++ samples/zephyr/hello_world_mini_boot/sysbuild.conf | 1 + .../zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf | 3 +++ 3 files changed, 9 insertions(+) create mode 100644 samples/zephyr/hello_world_mini_boot/VERSION diff --git a/samples/zephyr/hello_world_mini_boot/VERSION b/samples/zephyr/hello_world_mini_boot/VERSION new file mode 100644 index 00000000000..083d7bf3119 --- /dev/null +++ b/samples/zephyr/hello_world_mini_boot/VERSION @@ -0,0 +1,5 @@ +VERSION_MAJOR = 1 +VERSION_MINOR = 0 +PATCHLEVEL = 0 +VERSION_TWEAK = 0 +EXTRAVERSION = dev diff --git a/samples/zephyr/hello_world_mini_boot/sysbuild.conf b/samples/zephyr/hello_world_mini_boot/sysbuild.conf index 2276f176bb3..0f4dda0350c 100644 --- a/samples/zephyr/hello_world_mini_boot/sysbuild.conf +++ b/samples/zephyr/hello_world_mini_boot/sysbuild.conf @@ -1,3 +1,4 @@ # Enable MCUboot bootloader support SB_CONFIG_BOOTLOADER_MCUBOOT=y SB_CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256=y +SB_CONFIG_MCUBOOT_MODE_DIRECT_XIP=y diff --git a/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf b/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf index e0410ea2f98..ababbaf7d33 100644 --- a/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf +++ b/samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf @@ -57,3 +57,6 @@ CONFIG_PSA_CRYPTO_DRIVER_OBERON=n CONFIG_NRF_OBERON=y CONFIG_BOOT_ECDSA_NRF_OBERON_EXPERIMENT=y + +# NOTE: Needed for direct-xip +CONFIG_PM_PARTITION_SIZE_MCUBOOT=0x7000