Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions samples/zephyr/hello_world_mini_boot/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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/subsys/mgmt/mcumgr/smp_svr/src/main.c)
5 changes: 5 additions & 0 deletions samples/zephyr/hello_world_mini_boot/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
VERSION_MAJOR = 1
VERSION_MINOR = 0
PATCHLEVEL = 0
VERSION_TWEAK = 0
EXTRAVERSION = dev
49 changes: 49 additions & 0 deletions samples/zephyr/hello_world_mini_boot/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# NOTE: Copied from smp_svr_mini_boot

# 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

# Enable most core commands.
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

# Enable the Shell mcumgr transport.
CONFIG_BASE64=y
CONFIG_CRC=y
CONFIG_SHELL=y
CONFIG_SHELL_BACKEND_SERIAL=y
CONFIG_MCUMGR_TRANSPORT_SHELL=y

CONFIG_MCUMGR_TRANSPORT_NETBUF_SIZE=1220
CONFIG_MCUMGR_GRP_OS_MCUMGR_PARAMS=y
CONFIG_MCUMGR_TRANSPORT_WORKQUEUE_STACK_SIZE=4608

# 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
4 changes: 4 additions & 0 deletions samples/zephyr/hello_world_mini_boot/sysbuild.conf
Original file line number Diff line number Diff line change
@@ -0,0 +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
62 changes: 62 additions & 0 deletions samples/zephyr/hello_world_mini_boot/sysbuild/mcuboot/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# INFO: Config below from mcuboot's prj.conf

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_DBG=y
# TODO: Comment-out to enable mcuboot logs (increases footprint by ~ 1KiB)
CONFIG_SERIAL=n
CONFIG_CONSOLE=n
CONFIG_UART_CONSOLE=n

# INFO: Config below from mcuboot's soc/nrf54l05_cpuapp.conf

CONFIG_SPI_NOR=n

CONFIG_BOOT_WATCHDOG_FEED=n

# Ensure the fastest RRAM write operations
# 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


# 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.
CONFIG_SIZE_OPTIMIZATIONS=y

CONFIG_BOOT_BANNER=n
CONFIG_NCS_BOOT_BANNER=n
CONFIG_PRINTK=n
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

CONFIG_MINIMAL_LIBC=y
CONFIG_LTO=y
CONFIG_ISR_TABLES_LOCAL_DECLARATION=y

# 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.

CONFIG_SYS_CLOCK_EXISTS=n
CONFIG_NRF_GRTC_TIMER=n

CONFIG_PSA_CRYPTO_DRIVER_CRACEN=n
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
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading