Skip to content

Commit 7504e21

Browse files
nordic-seglrlubos
authored andcommitted
tests: benchmarks: multicore: Add test for S2RAM and PPR
Add non-functional check (current consumption) for sample application that: - runs on cpuapp, cpurad and cpuppr; - enters low power state. Confirm that when PPR core is used: - SOC may enter low power states like IDLE or S2RAM. Signed-off-by: Sebastian Głąb <[email protected]>
1 parent 49bcdd3 commit 7504e21

File tree

15 files changed

+470
-0
lines changed

15 files changed

+470
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#
2+
# Copyright (c) 2024 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+
11+
if(NOT SYSBUILD)
12+
message(FATAL_ERROR
13+
" This is a multi-image application that should be built using sysbuild.\n"
14+
" Add --sysbuild argument to west build command to prepare all the images.")
15+
endif()
16+
17+
project(idle_ppr)
18+
19+
target_sources(app PRIVATE src/main.c)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#
2+
# Copyright (c) 2024 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
config TEST_SLEEP_DURATION_MS
8+
int "Amount of time (in miliseconds) the core is sleeping"
9+
default 1000
10+
help
11+
Set sleep duration to TEST_SLEEP_DURATION_MS miliseconds.
12+
Based on the value of 'min-residency-us' specified for each power state defined in the DTS,
13+
core enters the lowest possible power state.
14+
15+
source "Kconfig.zephyr"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright (c) 2024 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
&cpuppr_vpr {
8+
status = "okay";
9+
};
10+
11+
&cpuppr_ram3x_region {
12+
status = "okay";
13+
};
14+
15+
16+
/ {
17+
aliases {
18+
/delete-property/ led1;
19+
};
20+
};
21+
22+
/delete-node/ &led1;
23+
24+
&gpiote130 {
25+
status = "okay";
26+
owned-channels = <0>;
27+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CONFIG_BOOT_BANNER=n
2+
CONFIG_NCS_BOOT_BANNER=n
3+
4+
CONFIG_LOG=y
5+
CONFIG_ASSERT=y
6+
CONFIG_GPIO=y
7+
8+
CONFIG_NRF_REGTOOL_VERBOSITY=1
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
CONFIG_PM=y
2+
CONFIG_PM_S2RAM=y
3+
CONFIG_PM_S2RAM_CUSTOM_MARKING=y
4+
CONFIG_POWEROFF=y
5+
CONFIG_SOC_NRF54H20_NO_MRAM_LATENCY=n
6+
7+
CONFIG_PM_DEVICE=y
8+
CONFIG_PM_DEVICE_RUNTIME=y
9+
10+
CONFIG_BOOT_BANNER=n
11+
CONFIG_NCS_BOOT_BANNER=n
12+
CONFIG_PRINTK=n
13+
CONFIG_LOG=n
14+
CONFIG_CONSOLE=n
15+
CONFIG_UART_CONSOLE=n
16+
CONFIG_SERIAL=n
17+
18+
CONFIG_ASSERT=y
19+
CONFIG_GPIO=y
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#
2+
# Copyright (c) 2024 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(remote)
11+
12+
target_sources(app PRIVATE ../src/main.c)
13+
14+
if((DEFINED CONFIG_SOC_NRF54H20_CPUPPR) OR (DEFINED CONFIG_SOC_NRF54H20_ENGB_CPUPPR))
15+
message(STATUS "Power Mode handler for RISC V is included.")
16+
target_sources(app PRIVATE ../src/power_off.c)
17+
endif()
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#
2+
# Copyright (c) 2024 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
config TEST_SLEEP_DURATION_MS
8+
int "Amount of time (in miliseconds) the core is sleeping"
9+
default 1000
10+
help
11+
Set sleep duration to TEST_SLEEP_DURATION_MS miliseconds.
12+
Based on the value of 'min-residency-us' specified for each power state defined in the DTS,
13+
core enters the lowest possible power state.
14+
15+
config APP_PROVIDE_PM_HOOKS
16+
bool "Application provides PM hooks"
17+
default y
18+
select HAS_PM
19+
select HAS_POWEROFF
20+
21+
source "Kconfig.zephyr"
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Copyright (c) 2024 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
aliases {
9+
led0 = &led3;
10+
};
11+
12+
leds {
13+
compatible = "gpio-leds";
14+
led3: led_3 {
15+
gpios = < &gpio9 0x3 0x0 >;
16+
label = "Green LED 3";
17+
};
18+
};
19+
20+
cpus {
21+
power-states {
22+
wait: wait {
23+
compatible = "zephyr,power-state";
24+
power-state-name = "standby";
25+
substate-id = <0>;
26+
min-residency-us = <20000>;
27+
};
28+
29+
hibernate: hibernate {
30+
compatible = "zephyr,power-state";
31+
power-state-name = "suspend-to-ram";
32+
substate-id = <0>;
33+
min-residency-us = <400000>;
34+
};
35+
};
36+
};
37+
};
38+
39+
&cpu {
40+
cpu-power-states = <&wait &hibernate>;
41+
};
42+
43+
&gpio9 {
44+
status = "okay";
45+
};
46+
47+
&gpiote130 {
48+
status = "okay";
49+
owned-channels = <2>;
50+
};
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (c) 2024 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
aliases {
9+
led0 = &led1;
10+
};
11+
12+
leds {
13+
compatible = "gpio-leds";
14+
led1: led_1 {
15+
gpios = < &gpio9 0x1 0x0 >;
16+
label = "Green LED 1";
17+
};
18+
};
19+
};
20+
21+
&gpio9 {
22+
status = "okay";
23+
};
24+
25+
&gpiote130 {
26+
status = "okay";
27+
owned-channels = <1>;
28+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CONFIG_LOG=n
2+
CONFIG_CONSOLE=n
3+
CONFIG_UART_CONSOLE=n
4+
CONFIG_SERIAL=n
5+
CONFIG_BOOT_BANNER=n
6+
CONFIG_NCS_BOOT_BANNER=n
7+
CONFIG_PRINTK=n
8+
9+
CONFIG_ASSERT=y
10+
CONFIG_GPIO=y
11+
12+
CONFIG_NRF_REGTOOL_VERBOSITY=1

0 commit comments

Comments
 (0)