Skip to content

Commit 7d7c3e4

Browse files
committed
samples: boards: nordic: spis_wakeup: Run sample on APP+PPR
Extend sample with possibility to use PPR core instead of Radio core. Signed-off-by: Sebastian Głąb <[email protected]>
1 parent 491498a commit 7d7c3e4

10 files changed

+202
-69
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright (c) 2025 Nordic Semiconductor ASA
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
source "$(ZEPHYR_BASE)/share/sysbuild/Kconfig"
5+
6+
choice REMOTE_NRF54H20_CORE
7+
prompt "Remote nRF54h20 core"
8+
default REMOTE_NRF54H20_CPURAD_CORE
9+
depends on SOC_NRF54H20_CPUAPP
10+
11+
config REMOTE_NRF54H20_CPUPPR_CORE
12+
bool "ppr core"
13+
14+
config REMOTE_NRF54H20_CPURAD_CORE
15+
bool "cpurad"
16+
17+
endchoice
18+
19+
config REMOTE_BOARD
20+
string
21+
default "$(BOARD)/nrf54h20/cpurad" if SOC_NRF54H20_CPUAPP && REMOTE_NRF54H20_CPURAD_CORE
22+
default "$(BOARD)/nrf54h20/cpuppr/xip" if SOC_NRF54H20_CPUAPP && REMOTE_NRF54H20_CPUPPR_CORE
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/ {
7+
aliases {
8+
led = &led0;
9+
spis = &spi130;
10+
/delete-property/ sw0;
11+
/delete-property/ sw1;
12+
/delete-property/ sw2;
13+
/delete-property/ sw3;
14+
};
15+
/delete-node/ buttons;
16+
};
17+
18+
&exmif {
19+
status = "disabled";
20+
};
21+
22+
&gpiote130 {
23+
status = "okay";
24+
owned-channels = <0>;
25+
};
26+
27+
&pinctrl {
28+
spi130_default_alt: spi130_default_alt {
29+
group1 {
30+
psels = <NRF_PSEL(SPIS_SCK, 0, 0)>,
31+
<NRF_PSEL(SPIS_MOSI, 0, 6)>,
32+
<NRF_PSEL(SPIS_MISO, 0, 8)>,
33+
<NRF_PSEL(SPIS_CSN, 0, 10)>;
34+
};
35+
};
36+
37+
spi130_sleep_alt: spi130_sleep_alt {
38+
group1 {
39+
psels = <NRF_PSEL(SPIS_SCK, 0, 0)>,
40+
<NRF_PSEL(SPIS_MOSI, 0, 6)>,
41+
<NRF_PSEL(SPIS_MISO, 0, 8)>,
42+
<NRF_PSEL(SPIS_CSN, 0, 10)>;
43+
low-power-enable;
44+
};
45+
};
46+
};
47+
48+
&spi130 {
49+
compatible = "nordic,nrf-spis";
50+
status = "okay";
51+
def-char = <0x00>;
52+
pinctrl-0 = <&spi130_default_alt>;
53+
pinctrl-1 = <&spi130_sleep_alt>;
54+
pinctrl-names = "default", "sleep";
55+
wake-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
56+
memory-regions = <&cpuapp_dma_region>;
57+
zephyr,pm-device-runtime-auto;
58+
/delete-property/ rx-delay-supported;
59+
/delete-property/ rx-delay;
60+
};
61+
62+
&uart136 {
63+
zephyr,pm-device-runtime-auto;
64+
};

samples/boards/nordic/spis_wakeup/boards/nrf54h20dk_nrf54h20_cpuapp.overlay

Lines changed: 3 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3,64 +3,13 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6+
#include "nrf54h20dk_nrf54h20_common.dtsi"
7+
8+
/* LED1 will be used by the cpurad core. */
69
/ {
710
aliases {
8-
led = &led0;
9-
spis = &spi130;
1011
/delete-property/ led1;
11-
/delete-property/ sw0;
12-
/delete-property/ sw1;
13-
/delete-property/ sw2;
14-
/delete-property/ sw3;
1512
};
16-
/delete-node/ buttons;
1713
};
1814

1915
/delete-node/ &led1;
20-
21-
&exmif {
22-
status = "disabled";
23-
};
24-
25-
&gpiote130 {
26-
status = "okay";
27-
owned-channels = <0>;
28-
};
29-
30-
&pinctrl {
31-
spi130_default_alt: spi130_default_alt {
32-
group1 {
33-
psels = <NRF_PSEL(SPIS_SCK, 0, 0)>,
34-
<NRF_PSEL(SPIS_MOSI, 0, 6)>,
35-
<NRF_PSEL(SPIS_MISO, 0, 8)>,
36-
<NRF_PSEL(SPIS_CSN, 0, 10)>;
37-
};
38-
};
39-
40-
spi130_sleep_alt: spi130_sleep_alt {
41-
group1 {
42-
psels = <NRF_PSEL(SPIS_SCK, 0, 0)>,
43-
<NRF_PSEL(SPIS_MOSI, 0, 6)>,
44-
<NRF_PSEL(SPIS_MISO, 0, 8)>,
45-
<NRF_PSEL(SPIS_CSN, 0, 10)>;
46-
low-power-enable;
47-
};
48-
};
49-
};
50-
51-
&spi130 {
52-
compatible = "nordic,nrf-spis";
53-
status = "okay";
54-
def-char = <0x00>;
55-
pinctrl-0 = <&spi130_default_alt>;
56-
pinctrl-1 = <&spi130_sleep_alt>;
57-
pinctrl-names = "default", "sleep";
58-
wake-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
59-
memory-regions = <&cpuapp_dma_region>;
60-
/delete-property/ rx-delay-supported;
61-
/delete-property/ rx-delay;
62-
};
63-
64-
&uart136 {
65-
zephyr,pm-device-runtime-auto;
66-
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include "nrf54h20dk_nrf54h20_common.dtsi"
7+
8+
&spi131 {
9+
status = "reserved";
10+
interrupt-parent = <&cpuppr_clic>;
11+
};
12+
13+
/*&uart135 {
14+
status = "reserved";
15+
interrupt-parent = <&cpuppr_clic>;
16+
};*/
Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,32 @@
11
common:
22
sysbuild: true
33
depends_on: spi
4+
tags:
5+
- spi
6+
harness: console
7+
harness_config:
8+
fixture: spi_loopback
9+
type: multi_line
10+
ordered: true
11+
regex:
12+
- ".*SPIS: waiting for SPI transfer"
13+
- ".*SPIS: woken up by"
414

515
sample:
616
name: SPI wakeup sample
717
tests:
818
sample.drivers.spis.wakeup:
9-
tags:
10-
- spi
1119
platform_allow:
1220
- nrf54h20dk/nrf54h20/cpuapp
1321
integration_platforms:
1422
- nrf54h20dk/nrf54h20/cpuapp
15-
harness: console
16-
harness_config:
17-
fixture: spi_loopback
18-
type: multi_line
19-
ordered: true
20-
regex:
21-
- ".*SPIS: waiting for SPI transfer"
22-
- ".*SPIS: woken up by"
23+
sample.drivers.spis.wakeup.ppr:
24+
platform_allow:
25+
- nrf54h20dk/nrf54h20/cpuapp
26+
integration_platforms:
27+
- nrf54h20dk/nrf54h20/cpuapp
28+
extra_args:
29+
- SB_CONFIG_REMOTE_NRF54H20_CPUPPR_CORE=y
30+
- spis_wakeup_CONFIG_SOC_NRF54H20_CPURAD_ENABLE=n
31+
- spis_wakeup_SNIPPET=nordic-ppr-xip
32+
- DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_with_cpuppr.overlay"

samples/boards/nordic/spis_wakeup/sysbuild.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
# SPDX-License-Identifier: Apache-2.0
44
#
55

6-
if(SB_CONFIG_SOC_NRF54H20)
6+
if(SB_CONFIG_REMOTE_BOARD)
77
# Add remote project
88
ExternalZephyrProject_Add(
99
APPLICATION wakeup_trigger
1010
SOURCE_DIR ${APP_DIR}/wakeup_trigger
11-
BOARD ${SB_CONFIG_BOARD}/${SB_CONFIG_SOC}/cpurad
11+
BOARD ${SB_CONFIG_REMOTE_BOARD}
1212
BOARD_REVISION ${BOARD_REVISION}
1313
)
1414
endif()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_ASSERT=n
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/ {
7+
aliases {
8+
led = &led1;
9+
};
10+
11+
leds {
12+
compatible = "gpio-leds";
13+
led1: led_1 {
14+
gpios = <&gpio9 1 GPIO_ACTIVE_HIGH>;
15+
label = "Green LED 1";
16+
};
17+
};
18+
};
19+
20+
&gpiote130 {
21+
status = "okay";
22+
owned-channels = <1>;
23+
};
24+
25+
&gpio0 {
26+
status = "okay";
27+
};
28+
29+
&gpio9 {
30+
status = "okay";
31+
};
32+
33+
&pinctrl {
34+
spi131_default_alt: spi131_default_alt {
35+
group1 {
36+
psels = <NRF_PSEL(SPIM_SCK, 0, 1)>,
37+
<NRF_PSEL(SPIM_MOSI, 0, 7)>,
38+
<NRF_PSEL(SPIM_MISO, 0, 9)>;
39+
};
40+
};
41+
42+
spi131_sleep_alt: spi131_sleep_alt {
43+
group1 {
44+
psels = <NRF_PSEL(SPIM_SCK, 0, 1)>,
45+
<NRF_PSEL(SPIM_MOSI, 0, 7)>,
46+
<NRF_PSEL(SPIM_MISO, 0, 9)>;
47+
low-power-enable;
48+
};
49+
};
50+
};
51+
52+
&spi131 {
53+
compatible = "nordic,nrf-spim";
54+
status = "okay";
55+
pinctrl-0 = <&spi131_default_alt>;
56+
pinctrl-1 = <&spi131_sleep_alt>;
57+
pinctrl-names = "default", "sleep";
58+
overrun-character = <0x00>;
59+
cs-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
60+
wake-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
61+
zephyr,pm-device-runtime-auto;
62+
spim_dt: spi-device@0 {
63+
compatible = "vnd,spi-device";
64+
reg = <0>;
65+
spi-max-frequency = <DT_FREQ_M(8)>;
66+
};
67+
};
68+
69+
&uart135 {
70+
zephyr,pm-device-runtime-auto;
71+
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CONFIG_PM=y
2+
3+
CONFIG_ASSERT=y

samples/boards/nordic/spis_wakeup/wakeup_trigger/prj.conf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ CONFIG_SPI=y
22
CONFIG_SPI_NRFX_WAKE_TIMEOUT_US=500
33
CONFIG_GPIO=y
44

5-
CONFIG_PM=y
65
CONFIG_PM_DEVICE=y
76
CONFIG_PM_DEVICE_RUNTIME=y
87

9-
CONFIG_ASSERT=y
10-
118
CONFIG_LOG=y

0 commit comments

Comments
 (0)