Skip to content

Commit 7eabde2

Browse files
nordic-seglnordic-piks
authored andcommitted
tests: benchmarks: multicore: idle_wdt: Add test on APP core only
Add test configuration where WDT is tested on APP core only. Allow comparison of current consumption in low power states when WDT is running in APP domain only or in both APP and Radio domains. Define sysbuild Kconfig that controls core synchronization in both sub-images. Signed-off-by: Sebastian Głąb <[email protected]>
1 parent 589733f commit 7eabde2

File tree

12 files changed

+136
-63
lines changed

12 files changed

+136
-63
lines changed

tests/benchmarks/multicore/idle_wdt/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,9 @@ config TEST_SLEEP_DURATION_MS
1212
Based on the value of 'min-residency-us' specified for each power state defined in the DTS,
1313
core enters the lowest possible power state.
1414

15+
config TEST_SYNCHRONIZE_CORES
16+
bool "Synchronization with other core"
17+
help
18+
When set to 'y' core will synchronize code execution with the other core.
19+
1520
source "Kconfig.zephyr"

tests/benchmarks/multicore/idle_wdt/Kconfig.sysbuild

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,33 @@
44
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
#
66

7-
source "share/sysbuild/Kconfig"
7+
choice NETCORE
8+
default NETCORE_REMOTE
9+
10+
config NETCORE_REMOTE
11+
bool "Remote image"
12+
13+
config NETCORE_REMOTE_SLEEP_FOREVER
14+
bool "Remote sleep forever image"
15+
16+
endchoice
817

9-
config REMOTE_BOARD
10-
string
11-
default "$(BOARD)/nrf54h20/cpurad" if SOC_NRF54H20_CPUAPP
18+
config NETCORE_IMAGE_NAME
19+
default "remote" if NETCORE_REMOTE
20+
default "remote_sleep_forever" if NETCORE_REMOTE_SLEEP_FOREVER
21+
22+
config NETCORE_IMAGE_PATH
23+
default "${ZEPHYR_NRF_MODULE_DIR}/tests/benchmarks/multicore/idle_wdt/remote" if NETCORE_REMOTE
24+
default "${ZEPHYR_NRF_MODULE_DIR}/tests/benchmarks/power_consumption/common/remote_sleep_forever" if NETCORE_REMOTE_SLEEP_FOREVER
25+
26+
config TEST_SYNCHRONIZE_CORES
27+
bool "Synchronize both cores"
28+
depends on NETCORE_REMOTE
29+
default y
30+
help
31+
When set to 'y' both cores will synchronize just before entering the main loop.
32+
This requires test code to be compiled for both Application and Radio cores.
33+
When one of the cores is flashed with remote_sleep_forever it will not confirm its readines.
34+
In such case, the other core will wait forever for event that never happens.
35+
36+
source "share/sysbuild/Kconfig"
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+
CONFIG_SOC_NRF54H20_CPURAD_ENABLE=y
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
CONFIG_PM=n
8+
CONFIG_PM_DEVICE=n
9+
CONFIG_PM_DEVICE_RUNTIME=n
10+
11+
CONFIG_PRINTK=y
12+
CONFIG_LOG=y
13+
CONFIG_CONSOLE=y
14+
CONFIG_UART_CONSOLE=y
15+
CONFIG_SERIAL=y
Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
1-
CONFIG_PRINTK=y
2-
CONFIG_LOG=y
3-
CONFIG_LOG_MODE_IMMEDIATE=y
4-
CONFIG_ASSERT=y
51
CONFIG_WATCHDOG=y
2+
CONFIG_GPIO=y
3+
4+
CONFIG_PM=y
5+
CONFIG_POWEROFF=y
6+
CONFIG_PM_DEVICE=y
7+
CONFIG_PM_DEVICE_RUNTIME=y
8+
9+
CONFIG_BOOT_BANNER=n
10+
CONFIG_NCS_BOOT_BANNER=n
11+
CONFIG_ASSERT=y
12+
13+
# Enable for debugging purposes only
14+
CONFIG_PRINTK=n
15+
CONFIG_LOG=n
16+
CONFIG_CONSOLE=n
17+
CONFIG_UART_CONSOLE=n
18+
CONFIG_SERIAL=n

tests/benchmarks/multicore/idle_wdt/prj_s2ram.conf

Lines changed: 0 additions & 17 deletions
This file was deleted.

tests/benchmarks/multicore/idle_wdt/remote/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,9 @@ config TEST_ROLE_REMOTE
1919
KConfig used in synchronization phase.
2020
Set TEST_ROLE_REMOTE=y on core that shall synchronize with the Host core.
2121

22+
config TEST_SYNCHRONIZE_CORES
23+
bool "Synchronization with other core"
24+
help
25+
When set to 'y' core will synchronize code execution with the other core.
26+
2227
source "Kconfig.zephyr"
Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1-
CONFIG_PRINTK=y
2-
CONFIG_LOG=y
3-
CONFIG_LOG_MODE_IMMEDIATE=y
4-
CONFIG_ASSERT=y
51
CONFIG_WATCHDOG=y
62
CONFIG_GPIO=y
3+
4+
CONFIG_PM=y
5+
CONFIG_POWEROFF=y
6+
CONFIG_PM_DEVICE=y
7+
CONFIG_PM_DEVICE_RUNTIME=y
8+
9+
CONFIG_BOOT_BANNER=n
10+
CONFIG_NCS_BOOT_BANNER=n
11+
CONFIG_ASSERT=y
12+
13+
# Enable for debugging purposes only
14+
CONFIG_PRINTK=n
15+
CONFIG_LOG=n
16+
CONFIG_CONSOLE=n
17+
CONFIG_UART_CONSOLE=n
18+
CONFIG_SERIAL=n

tests/benchmarks/multicore/idle_wdt/remote/prj_s2ram.conf

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/benchmarks/multicore/idle_wdt/src/main.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ int main(void)
104104
__ASSERT(false, "wdt_install_timeout() returned %d\n", my_wdt_channel);
105105
}
106106

107+
#if defined(CONFIG_TEST_SYNCHRONIZE_CORES)
107108
/* Synchronize Remote core with Host core */
108109
#if !defined(CONFIG_TEST_ROLE_REMOTE)
109110
LOG_DBG("HOST starts");
@@ -115,8 +116,8 @@ int main(void)
115116
sys_cache_data_invd_range((void *) shared_var, sizeof(*shared_var));
116117
LOG_DBG("shared_var is: %u", *shared_var);
117118
}
118-
LOG_DBG("HOST continues");
119-
#else
119+
LOG_INF("HOST continues");
120+
#else /* !defined(CONFIG_TEST_ROLE_REMOTE) */
120121
LOG_DBG("REMOTE starts");
121122
while (*shared_var != HOST_IS_READY) {
122123
k_msleep(1);
@@ -127,8 +128,9 @@ int main(void)
127128
*shared_var = REMOTE_IS_READY;
128129
sys_cache_data_flush_range((void *) shared_var, sizeof(*shared_var));
129130
LOG_DBG("REMOTE wrote REMOTE_IS_READY: %u", *shared_var);
130-
LOG_DBG("REMOTE continues");
131-
#endif
131+
LOG_INF("REMOTE continues");
132+
#endif /* !defined(CONFIG_TEST_ROLE_REMOTE) */
133+
#endif /* defined(CONFIG_TEST_SYNCHRONIZE_CORES) */
132134

133135
/* Start Watchdog */
134136
ret = wdt_setup(my_wdt_device, WDT_OPT_PAUSE_HALTED_BY_DBG | WDT_OPT_PAUSE_IN_SLEEP);

0 commit comments

Comments
 (0)