Skip to content

Commit 1afa11d

Browse files
nordic-baminordic-piks
authored andcommitted
tests: benchmarks: Test power consumption for Mcuboot in dicrect xip mode
Extend Mcuboot PM testing for Direct Xip mode Signed-off-by: Bartosz Miller <[email protected]>
1 parent e9e0797 commit 1afa11d

9 files changed

+129
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#include "nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay"
8+
#include "../sysbuild/nrf54h20dk_nrf54h20_memory_map_merged_slot.dtsi"
9+
10+
secondary_app_partition: &cpuapp_slot1_partition {};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CONFIG_PM=y
2+
CONFIG_POWEROFF=y
3+
CONFIG_CONSOLE=n
4+
CONFIG_UART_CONSOLE=n
5+
CONFIG_SERIAL=n
6+
CONFIG_GPIO=y
7+
CONFIG_BOOT_BANNER=n
8+
CONFIG_NCS_BOOT_BANNER=n
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#include "nrf54h20dk_nrf54h20_cpurad_s2ram.overlay"
8+
#include "../../sysbuild/nrf54h20dk_nrf54h20_memory_map_merged_slot.dtsi"
9+
10+
secondary_app_partition: &cpurad_slot1_partition {};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CONFIG_PM=y
2+
CONFIG_POWEROFF=y
3+
CONFIG_CONSOLE=n
4+
CONFIG_UART_CONSOLE=n
5+
CONFIG_SERIAL=n
6+
CONFIG_GPIO=y
7+
CONFIG_BOOT_BANNER=n
8+
CONFIG_NCS_BOOT_BANNER=n
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
CONFIG_LOG=n
2+
CONFIG_SERIAL=n
3+
4+
CONFIG_SOC_EARLY_RESET_HOOK=y
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+
#include "../boards/nrf54h20dk_nrf54h20_cpuapp_s2ram.overlay"
8+
#include "nrf54h20dk_nrf54h20_memory_map_merged_slot.dtsi"
9+
10+
/ {
11+
chosen {
12+
zephyr,code-partition = &boot_partition;
13+
};
14+
};
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/* On nRF54H20 the Direct XIP mode is supported in the merged slot configuration
8+
* Extend slot0_partition and slot1_partition to cover both application and
9+
* radio images, as well as MCUboot image metadata (header and trailer).
10+
* Those partitions will be used by MCUboot to verify the merged image to boot.
11+
* Apart from that, they will be used by the MCUmgr subsystem to correctly
12+
* handle flags, stored inside the MCUboot image trailer.
13+
* Use cpu<app|rad>_slot<0|1>_partition as zephyr,code-partition, so the
14+
* application and radio sizes are correctly reported.
15+
*/
16+
/delete-node/&cpuapp_slot0_partition;
17+
/delete-node/&cpuapp_slot1_partition;
18+
/delete-node/&cpurad_slot0_partition;
19+
/delete-node/&cpurad_slot1_partition;
20+
21+
&mram1x {
22+
partitions {
23+
/* Merged partition used by the MCUboot (variant 0). */
24+
slot0_partition: partition@40000 {
25+
reg = <0x40000 DT_SIZE_K(656)>;
26+
};
27+
28+
/* Application code partition (variant 0).
29+
* Offset by the MCUboot header size (2048 bytes).
30+
*/
31+
cpuapp_slot0_partition: partition@40800 {
32+
reg = <0x40800 DT_SIZE_K(326)>;
33+
};
34+
35+
/* Radio code partition (variant 0). */
36+
cpurad_slot0_partition: partition@92000 {
37+
reg = <0x92000 DT_SIZE_K(328)>;
38+
};
39+
40+
/* Merged partition used by the MCUboot (variant 1). */
41+
slot1_partition: partition@100000 {
42+
reg = <0x100000 DT_SIZE_K(656)>;
43+
};
44+
45+
/* Application code partition (variant 1).
46+
* Offset by the MCUboot header size (2048 bytes).
47+
*/
48+
cpuapp_slot1_partition: partition@100800 {
49+
reg = <0x100800 DT_SIZE_K(326)>;
50+
};
51+
52+
/* Radio code partition (variant 1). */
53+
cpurad_slot1_partition: partition@152000 {
54+
reg = <0x152000 DT_SIZE_K(328)>;
55+
};
56+
};
57+
};
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SB_CONFIG_MCUBOOT_MODE_DIRECT_XIP_WITH_REVERT=y
2+
SB_CONFIG_MCUBOOT_IMAGES_ROM_END_OFFSET_AUTO="remote;remote_secondary_app"

tests/benchmarks/multicore/idle_gpio/testcase.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,22 @@ tests:
5959
- "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_simple"
6060
tags: ppk_power_measure
6161

62+
benchmarks.multicore.idle_gpio.nrf54h20dk_cpuapp_cpurad.s2ram.mcuboot.direct_xip:
63+
platform_allow:
64+
- nrf54h20dk/nrf54h20/cpuapp
65+
integration_platforms:
66+
- nrf54h20dk/nrf54h20/cpuapp
67+
extra_args:
68+
- FILE_SUFFIX=s2ram_merged_slot
69+
- SB_CONFIG_BOOTLOADER_MCUBOOT=y
70+
- SB_EXTRA_CONF_FILE="sysbuild/sysbuild_merged_slot.conf"
71+
harness: pytest
72+
harness_config:
73+
fixture: ppk_power_measure
74+
pytest_root:
75+
- "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_simple"
76+
tags: ppk_power_measure
77+
6278
benchmarks.multicore.idle_gpio.nrf54h20dk_cpuapp_cpurad.s2ram.wakeup_from_uart_pins:
6379
platform_allow:
6480
- nrf54h20dk/nrf54h20/cpuapp

0 commit comments

Comments
 (0)