Skip to content

Commit 525f2b9

Browse files
nordicjmnashif
authored andcommitted
samples: mgmt: mcumgr: smp_svr: Add RAM load configuration
Adds configuration for booting this sample in RAM load mode on nrf52840dk Signed-off-by: Jamie McCrae <[email protected]>
1 parent 646f116 commit 525f2b9

File tree

8 files changed

+135
-0
lines changed

8 files changed

+135
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_RETAINED_MEM_NRF_GPREGRET=n
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/delete-node/ &sram0;
2+
3+
#include "../sysbuild/nrf52840dk_nrf52840_mcuboot_ram_load.overlay"
4+
5+
/ {
6+
chosen {
7+
zephyr,flash = &flash0;
8+
/delete-property/ zephyr,code-partition;
9+
};
10+
11+
soc {
12+
sram0: memory@20006000 {
13+
compatible = "mmio-sram";
14+
reg = <0x20006000 DT_SIZE_K(200)>;
15+
};
16+
};
17+
};
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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=2048
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_OS=y
34+
CONFIG_MCUMGR_GRP_STAT=y
35+
36+
# Enable logging
37+
CONFIG_LOG=y
38+
CONFIG_MCUBOOT_UTIL_LOG_LEVEL_WRN=y
39+
40+
# Disable debug logging
41+
CONFIG_LOG_MAX_LEVEL=3
42+
43+
# Enable retained memory and retention
44+
CONFIG_RETAINED_MEM=y
45+
CONFIG_RETENTION=y
46+
CONFIG_RETAINED_MEM_ZEPHYR_RAM=y
47+
CONFIG_RETENTION_BOOTLOADER_INFO=y
48+
CONFIG_RETENTION_BOOTLOADER_INFO_TYPE_MCUBOOT=y

samples/subsys/mgmt/mcumgr/smp_svr/sample.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,26 @@ tests:
158158
- mg100
159159
integration_platforms:
160160
- nrf52840dk/nrf52840
161+
sample.mcumgr.smp_svr.ram_load:
162+
sysbuild: true
163+
extra_args: FILE_SUFFIX="ram_load"
164+
platform_allow:
165+
- nrf52840dk/nrf52840
166+
integration_platforms:
167+
- nrf52840dk/nrf52840
168+
sample.mcumgr.smp_svr.ram_load.serial:
169+
sysbuild: true
170+
extra_args: FILE_SUFFIX="ram_load"
171+
EXTRA_CONF_FILE="overlay-serial.conf"
172+
platform_allow:
173+
- nrf52840dk/nrf52840
174+
integration_platforms:
175+
- nrf52840dk/nrf52840
176+
sample.mcumgr.smp_svr.ram_load.serial.fs.shell:
177+
sysbuild: true
178+
extra_args: FILE_SUFFIX="ram_load"
179+
EXTRA_CONF_FILE="overlay-serial.conf;overlay-fs.conf;overlay-shell.conf"
180+
platform_allow:
181+
- nrf52840dk/nrf52840
182+
integration_platforms:
183+
- nrf52840dk/nrf52840
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
if("${FILE_SUFFIX}" STREQUAL "ram_load")
4+
set(mcuboot_EXTRA_DTC_OVERLAY_FILE "${CMAKE_CURRENT_LIST_DIR}/nrf52840dk_nrf52840_mcuboot_ram_load.overlay" CACHE INTERNAL "" FORCE)
5+
endif()
6+
7+
find_package(Sysbuild REQUIRED HINTS $ENV{ZEPHYR_BASE})
8+
9+
project(sysbuild LANGUAGES)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CONFIG_SRAM_SIZE=30
2+
CONFIG_RETAINED_MEM=y
3+
CONFIG_RETENTION=y
4+
CONFIG_RETAINED_MEM_ZEPHYR_RAM=y
5+
CONFIG_BOOT_SHARE_DATA=y
6+
CONFIG_BOOT_SHARE_DATA_BOOTINFO=y
7+
CONFIG_BOOT_SHARE_BACKEND_RETENTION=y
8+
CONFIG_FLASH=y
9+
CONFIG_FLASH_MAP=y
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/ {
2+
sram@2003F000 {
3+
compatible = "zephyr,memory-region", "mmio-sram";
4+
reg = <0x2003F000 DT_SIZE_K(1)>;
5+
zephyr,memory-region = "RetainedMem";
6+
status = "okay";
7+
8+
retainedmem {
9+
compatible = "zephyr,retained-ram";
10+
status = "okay";
11+
#address-cells = <1>;
12+
#size-cells = <1>;
13+
14+
boot_info0: boot_info@0 {
15+
compatible = "zephyr,retention";
16+
status = "okay";
17+
reg = <0x0 0x100>;
18+
};
19+
};
20+
};
21+
22+
chosen {
23+
zephyr,bootloader-info = &boot_info0;
24+
};
25+
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Enable MCUboot bootloader support and use RAM load mode
2+
SB_CONFIG_BOOTLOADER_MCUBOOT=y
3+
SB_CONFIG_MCUBOOT_MODE_RAM_LOAD=y

0 commit comments

Comments
 (0)