Skip to content

Commit c68518a

Browse files
jnsgsrrlubos
authored andcommitted
tests: bootloader: BC: align serial recovery and AB
Align serial recovery and AB configs for 3.2 BC tests. Signed-off-by: Janusz Gąsior <janusz.gasior@nordicsemi.no> (cherry picked from commit cc9acb2)
1 parent fdf00fd commit c68518a

14 files changed

Lines changed: 320 additions & 0 deletions
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#
2+
# Copyright (c) 2026 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
cmake_minimum_required(VERSION 3.20.0)
8+
9+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
10+
project(ab)
11+
12+
set(ab_sample_dir ${ZEPHYR_NRF_MODULE_DIR}/samples/dfu/ab)
13+
14+
target_sources(app PRIVATE
15+
${ab_sample_dir}/src/main.c
16+
${ab_sample_dir}/src/ab_utils.c
17+
)
18+
19+
target_include_directories(app PRIVATE
20+
${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include
21+
${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include
22+
${ZEPHYR_BASE}/samples/subsys/mgmt/mcumgr/smp_svr/src
23+
${ab_sample_dir}/src
24+
)
25+
26+
target_sources_ifdef(CONFIG_MCUMGR_TRANSPORT_BT app PRIVATE
27+
${ZEPHYR_BASE}/samples/subsys/mgmt/mcumgr/smp_svr/src/bluetooth.c
28+
)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
config N_BLINKS
8+
int "Number of fast blinks"
9+
default 1
10+
11+
config EMULATE_APP_HEALTH_CHECK_FAILURE
12+
bool "Blocks confirmation of being healthy after the update"
13+
14+
source "Kconfig.zephyr"
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
if SOC_SERIES_NRF54H
8+
9+
# Enable radiocore
10+
config NRF_DEFAULT_IPC_RADIO
11+
default y
12+
13+
config NETCORE_IPC_RADIO_BT_HCI_IPC
14+
default y
15+
16+
config MCUBOOT_IMAGES_ROM_END_OFFSET_AUTO
17+
default "ipc_radio;ipc_radio_secondary_app"
18+
19+
endif # SOC_SERIES_NRF54H
20+
21+
source "share/sysbuild/Kconfig"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Enable boot requests through retained memory.
2+
CONFIG_RETAINED_MEM=y
3+
CONFIG_RETENTION=y
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#include "../nrf54l15dk_nrf54l15_cpuapp_common.dtsi"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
chosen {
9+
nrf,bootloader-request = &boot_request;
10+
};
11+
};
12+
13+
/ {
14+
cpuapp_sram@2003fff0 {
15+
compatible = "zephyr,memory-region", "mmio-sram";
16+
reg = <0x2003fff0 0x10>;
17+
zephyr,memory-region = "RetainedMem";
18+
status = "okay";
19+
20+
retainedmem {
21+
compatible = "zephyr,retained-ram";
22+
status = "okay";
23+
#address-cells = <1>;
24+
#size-cells = <1>;
25+
26+
boot_request: boot_request@0 {
27+
compatible = "zephyr,retention";
28+
status = "okay";
29+
reg = <0x0 0x10>;
30+
prefix = [0b 01];
31+
checksum = <4>;
32+
};
33+
};
34+
};
35+
};
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
EMPTY_0:
2+
address: 0x10800
3+
end_address: 0x11000
4+
region: flash_primary
5+
size: 0x800
6+
mcuboot:
7+
address: 0x0
8+
end_address: 0x10800
9+
region: flash_primary
10+
size: 0x10800
11+
mcuboot_secondary_pad:
12+
address: 0xb8000
13+
end_address: 0xb8800
14+
region: flash_primary
15+
size: 0x800
16+
mcuboot_secondary_app:
17+
address: 0xb8800
18+
end_address: 0x15f000
19+
region: flash_primary
20+
size: 0xa6800
21+
mcuboot_secondary:
22+
address: 0xb8000
23+
end_address: 0x15f000
24+
orig_span: &id003
25+
- mcuboot_secondary_pad
26+
- mcuboot_secondary_app
27+
region: flash_primary
28+
size: 0xa7000
29+
span: *id003
30+
littlefs_storage:
31+
address: 0x15f000
32+
end_address: 0x165000
33+
region: flash_primary
34+
size: 0x6000
35+
reserved_tail:
36+
address: 0x165000
37+
end_address: 0x17d000
38+
region: flash_primary
39+
size: 0x18000
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Enable MCUmgr and dependencies.
2+
CONFIG_NET_BUF=y
3+
CONFIG_ZCBOR=y
4+
CONFIG_CRC=y
5+
CONFIG_MCUMGR=y
6+
CONFIG_STREAM_FLASH=y
7+
CONFIG_FLASH_MAP=y
8+
9+
# Some command handlers require a large stack.
10+
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2304
11+
CONFIG_MAIN_STACK_SIZE=2176
12+
13+
# Ensure an MCUboot-compatible binary is generated.
14+
CONFIG_BOOTLOADER_MCUBOOT=y
15+
16+
# Enable flash operations.
17+
CONFIG_FLASH=y
18+
19+
# Required by the `taskstat` command.
20+
CONFIG_THREAD_MONITOR=y
21+
22+
# Support for taskstat command
23+
CONFIG_MCUMGR_GRP_OS_TASKSTAT=y
24+
25+
# Enable statistics and statistic names.
26+
CONFIG_STATS=y
27+
CONFIG_STATS_NAMES=y
28+
29+
# Enable most core commands.
30+
CONFIG_FLASH=y
31+
CONFIG_IMG_MANAGER=y
32+
CONFIG_MCUMGR_GRP_IMG=y
33+
CONFIG_MCUMGR_GRP_IMG_NRF=y
34+
CONFIG_MCUMGR_GRP_OS=y
35+
CONFIG_MCUMGR_GRP_STAT=y
36+
37+
# Enable logging
38+
CONFIG_LOG=y
39+
CONFIG_MCUBOOT_UTIL_LOG_LEVEL_WRN=y
40+
41+
# Disable debug logging
42+
CONFIG_LOG_MAX_LEVEL=3
43+
44+
# Enable boot requests.
45+
CONFIG_NRF_MCUBOOT_BOOT_REQUEST=y
46+
47+
# Enable DK LED/button library
48+
CONFIG_DK_LIBRARY=y
49+
50+
# Configure bluetooth
51+
52+
CONFIG_BT=y
53+
CONFIG_BT_PERIPHERAL=y
54+
55+
# Allow for large Bluetooth data packets.
56+
CONFIG_BT_L2CAP_TX_MTU=498
57+
CONFIG_BT_BUF_ACL_RX_SIZE=502
58+
CONFIG_BT_BUF_ACL_TX_SIZE=502
59+
60+
# Enable the Bluetooth mcumgr transport (unauthenticated).
61+
CONFIG_MCUMGR_TRANSPORT_BT=y
62+
CONFIG_MCUMGR_TRANSPORT_BT_CONN_PARAM_CONTROL=y
63+
64+
# Enable the Shell mcumgr transport.
65+
CONFIG_BASE64=y
66+
CONFIG_CRC=y
67+
CONFIG_SHELL=y
68+
CONFIG_SHELL_BACKEND_SERIAL=y
69+
CONFIG_MCUMGR_TRANSPORT_SHELL=y
70+
71+
# Enable the mcumgr Packet Reassembly feature over Bluetooth and its configuration dependencies.
72+
# MCUmgr buffer size is optimized to fit one SMP packet divided into five Bluetooth Write Commands,
73+
# transmitted with the maximum possible MTU value: 498 bytes.
74+
CONFIG_MCUMGR_TRANSPORT_BT_REASSEMBLY=y
75+
CONFIG_MCUMGR_TRANSPORT_NETBUF_SIZE=2475
76+
CONFIG_MCUMGR_GRP_OS_MCUMGR_PARAMS=y
77+
CONFIG_MCUMGR_TRANSPORT_WORKQUEUE_STACK_SIZE=4608
78+
79+
# Enable the LittleFS file system.
80+
CONFIG_FILE_SYSTEM=y
81+
CONFIG_FILE_SYSTEM_LITTLEFS=y
82+
83+
# Enable file system commands
84+
CONFIG_MCUMGR_GRP_FS=y
85+
86+
# Enable the storage erase command.
87+
CONFIG_MCUMGR_GRP_ZBASIC=y
88+
CONFIG_MCUMGR_GRP_ZBASIC_STORAGE_ERASE=y
89+
90+
# Disable Bluetooth ping support
91+
CONFIG_BT_CTLR_LE_PING=n
92+
93+
# Disable shell commands that are not needed
94+
CONFIG_CLOCK_CONTROL_NRF_SHELL=n
95+
CONFIG_DEVICE_SHELL=n
96+
CONFIG_DEVMEM_SHELL=n
97+
CONFIG_FLASH_SHELL=n
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Enable MCUboot bootloader support
2+
SB_CONFIG_BOOTLOADER_MCUBOOT=y
3+
4+
# Enable direct XIP with revert support
5+
SB_CONFIG_MCUBOOT_MODE_DIRECT_XIP_WITH_REVERT=y
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CONFIG_PM_PARTITION_SIZE_MCUBOOT=0x10800
2+
3+
# The default MCUboot is too large to support fprotect.
4+
CONFIG_FPROTECT=n
5+
6+
# Enable boot requests through retained memory.
7+
CONFIG_RETAINED_MEM=y
8+
CONFIG_RETENTION=y

0 commit comments

Comments
 (0)