Skip to content

Commit 3aed99f

Browse files
nordic-seglnordic-piks
authored andcommitted
tests: benchmarks: multicore: Run idle_spim on PPR
Extend power consumption tests with configuration that uses SPI driver on PPR core. Signed-off-by: Sebastian Głąb <[email protected]>
1 parent c274774 commit 3aed99f

File tree

11 files changed

+155
-3
lines changed

11 files changed

+155
-3
lines changed

tests/benchmarks/multicore/idle_spim/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,8 @@ endif()
1717
project(idle_spim)
1818

1919
target_sources(app PRIVATE src/main.c)
20+
21+
if(CONFIG_SOC_NRF54H20_CPUPPR)
22+
message(DEBUG "Power Mode handler for RISC V is included.")
23+
target_sources(app PRIVATE ${ZEPHYR_NRF_MODULE_DIR}/tests/benchmarks/multicore/common/power_off.c)
24+
endif()
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
config APP_PROVIDE_PM_HOOKS
8+
bool "Application provides PM hooks"
9+
default y if SOC_NRF54H20_CPUPPR
10+
select HAS_PM
11+
select HAS_POWEROFF
12+
13+
source "Kconfig.zephyr"

tests/benchmarks/multicore/idle_spim/Kconfig.sysbuild

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,9 @@ config NETCORE_IMAGE_NAME
1919

2020
config NETCORE_IMAGE_PATH
2121
default "${ZEPHYR_NRF_MODULE_DIR}/tests/benchmarks/power_consumption/common/remote_sleep_forever" if NETCORE_REMOTE_SLEEP_FOREVER
22+
23+
config SUPPORT_NETCORE
24+
default y if (SOC_NRF54H20_CPUPPR || SOC_NRF54H20_CPUAPP)
25+
26+
config NETCORE_REMOTE_BOARD_TARGET_CPUCLUSTER
27+
default "cpurad" if (SOC_NRF54H20_CPUPPR || SOC_NRF54H20_CPUAPP)

tests/benchmarks/multicore/idle_spim/boards/nrf54h20dk_nrf54h20_cpuapp.conf

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

7+
CONFIG_PM_S2RAM=y
8+
CONFIG_PM_S2RAM_CUSTOM_MARKING=y
9+
710
CONFIG_SOC_NRF54H20_CPURAD_ENABLE=y
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CONFIG_NCS_BOOT_BANNER=n
2+
CONFIG_EARLY_CONSOLE=n
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
aliases {
9+
led = &led0;
10+
};
11+
12+
leds {
13+
compatible = "gpio-leds";
14+
15+
led0: led_0 {
16+
gpios = < &gpio9 0x0 0x0 >;
17+
label = "Green LED 0";
18+
};
19+
};
20+
21+
cpus {
22+
power-states {
23+
wait: wait {
24+
compatible = "zephyr,power-state";
25+
power-state-name = "standby";
26+
substate-id = <0>;
27+
min-residency-us = <20000>;
28+
};
29+
30+
hibernate: hibernate {
31+
compatible = "zephyr,power-state";
32+
power-state-name = "suspend-to-ram";
33+
substate-id = <0>;
34+
min-residency-us = <400000>;
35+
};
36+
};
37+
};
38+
};
39+
40+
&cpu {
41+
cpu-power-states = <&wait &hibernate>;
42+
};
43+
44+
&gpio2 {
45+
status = "disabled";
46+
};
47+
48+
&gpio9 {
49+
status = "okay";
50+
};
51+
52+
&gpiote130 {
53+
status = "okay";
54+
};
55+
56+
&i2c130 {
57+
status = "disabled";
58+
};
59+
60+
&spi131 {
61+
zephyr,pm-device-runtime-auto;
62+
};

tests/benchmarks/multicore/idle_spim/prj.conf

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ CONFIG_SPI=y
22
CONFIG_GPIO=y
33

44
CONFIG_PM=y
5-
CONFIG_PM_S2RAM=y
6-
CONFIG_PM_S2RAM_CUSTOM_MARKING=y
75
CONFIG_PM_DEVICE=y
86
CONFIG_PM_DEVICE_RUNTIME=y
97
CONFIG_POWEROFF=y
10-
CONFIG_BOOT_BANNER=n
118

9+
CONFIG_BOOT_BANNER=n
1210
CONFIG_ASSERT=y
1311

1412
# Enable for debugging purposes only

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ void spi_read_register(uint8_t register_address, uint8_t *register_value)
3636
__ASSERT(rc == 0, "Error: spi_transceive_dt, err: %d\n", rc);
3737
*register_value = rx_buffer[2];
3838

39+
__ASSERT(rx_buffer[2] == 0x24, "Invalid CHIP ID %x (0x24)", rx_buffer[2]);
40+
3941
printk("'spi_transceive_dt', rx_data: %x %x %x\n", rx_buffer[0], rx_buffer[1],
4042
rx_buffer[2]);
4143
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
aliases {
9+
/delete-property/ led0;
10+
/delete-property/ led1;
11+
/delete-property/ mcuboot-led0;
12+
};
13+
};
14+
15+
/delete-node/ &led0;
16+
/delete-node/ &led1;
17+
18+
&exmif {
19+
status = "disabled";
20+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
CONFIG_PM=y
2+
CONFIG_PM_DEVICE=y
3+
CONFIG_PM_DEVICE_RUNTIME=y
4+
CONFIG_POWEROFF=y
5+
CONFIG_PM_S2RAM=y
6+
CONFIG_PM_S2RAM_CUSTOM_MARKING=y
7+
8+
CONFIG_SOC_NRF54H20_CPURAD_ENABLE=y
9+
10+
CONFIG_BOOT_BANNER=n
11+
CONFIG_PRINTK=n
12+
CONFIG_LOG=n
13+
CONFIG_CONSOLE=n
14+
CONFIG_UART_CONSOLE=n
15+
CONFIG_SERIAL=n

0 commit comments

Comments
 (0)