Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions samples/boards/nordic/spis_wakeup/Kconfig.sysbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (c) 2025 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

source "$(ZEPHYR_BASE)/share/sysbuild/Kconfig"

choice REMOTE_NRF54H20_CORE
prompt "Remote nRF54h20 core"
default REMOTE_NRF54H20_CPURAD_CORE
depends on SOC_NRF54H20_CPUAPP

config REMOTE_NRF54H20_CPUPPR_CORE
bool "ppr core"

config REMOTE_NRF54H20_CPURAD_CORE
bool "cpurad"

endchoice

config REMOTE_BOARD
string
default "$(BOARD)/nrf54h20/cpurad" if SOC_NRF54H20_CPUAPP && REMOTE_NRF54H20_CPURAD_CORE
default "$(BOARD)/nrf54h20/cpuppr/xip" if SOC_NRF54H20_CPUAPP && REMOTE_NRF54H20_CPUPPR_CORE
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now, there are two sample configurations: APP+Radio and APP+PPR.
I moved common DTS part on APP to a separate file.

Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
* SPDX-License-Identifier: Apache-2.0
*/

/ {
aliases {
led = &led0;
spis = &spi130;
/delete-property/ sw0;
/delete-property/ sw1;
/delete-property/ sw2;
/delete-property/ sw3;
};
/delete-node/ buttons;
};

&exmif {
status = "disabled";
};

&gpiote130 {
status = "okay";
owned-channels = <0>;
};

&pinctrl {
spi130_default_alt: spi130_default_alt {
group1 {
psels = <NRF_PSEL(SPIS_SCK, 0, 0)>,
<NRF_PSEL(SPIS_MOSI, 0, 6)>,
<NRF_PSEL(SPIS_MISO, 0, 8)>,
<NRF_PSEL(SPIS_CSN, 0, 10)>;
};
};

spi130_sleep_alt: spi130_sleep_alt {
group1 {
psels = <NRF_PSEL(SPIS_SCK, 0, 0)>,
<NRF_PSEL(SPIS_MOSI, 0, 6)>,
<NRF_PSEL(SPIS_MISO, 0, 8)>,
<NRF_PSEL(SPIS_CSN, 0, 10)>;
low-power-enable;
};
};
};

&spi130 {
compatible = "nordic,nrf-spis";
status = "okay";
def-char = <0x00>;
pinctrl-0 = <&spi130_default_alt>;
pinctrl-1 = <&spi130_sleep_alt>;
pinctrl-names = "default", "sleep";
wake-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
memory-regions = <&cpuapp_dma_region>;
zephyr,pm-device-runtime-auto;
/delete-property/ rx-delay-supported;
/delete-property/ rx-delay;
};

&uart136 {
zephyr,pm-device-runtime-auto;
};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include common and delete references to led1. Otherwise Radio core will not be able to take ownership of the led1.

Original file line number Diff line number Diff line change
Expand Up @@ -3,64 +3,13 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include "nrf54h20dk_nrf54h20_common.dtsi"

/* LED1 will be used by the cpurad core. */
/ {
aliases {
led = &led0;
spis = &spi130;
/delete-property/ led1;
/delete-property/ sw0;
/delete-property/ sw1;
/delete-property/ sw2;
/delete-property/ sw3;
};
/delete-node/ buttons;
};

/delete-node/ &led1;

&exmif {
status = "disabled";
};

&gpiote130 {
status = "okay";
owned-channels = <0>;
};

&pinctrl {
spi130_default_alt: spi130_default_alt {
group1 {
psels = <NRF_PSEL(SPIS_SCK, 0, 0)>,
<NRF_PSEL(SPIS_MOSI, 0, 6)>,
<NRF_PSEL(SPIS_MISO, 0, 8)>,
<NRF_PSEL(SPIS_CSN, 0, 10)>;
};
};

spi130_sleep_alt: spi130_sleep_alt {
group1 {
psels = <NRF_PSEL(SPIS_SCK, 0, 0)>,
<NRF_PSEL(SPIS_MOSI, 0, 6)>,
<NRF_PSEL(SPIS_MISO, 0, 8)>,
<NRF_PSEL(SPIS_CSN, 0, 10)>;
low-power-enable;
};
};
};

&spi130 {
compatible = "nordic,nrf-spis";
status = "okay";
def-char = <0x00>;
pinctrl-0 = <&spi130_default_alt>;
pinctrl-1 = <&spi130_sleep_alt>;
pinctrl-names = "default", "sleep";
wake-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
memory-regions = <&cpuapp_dma_region>;
/delete-property/ rx-delay-supported;
/delete-property/ rx-delay;
};

&uart136 {
zephyr,pm-device-runtime-auto;
};
Copy link
Contributor Author

@nordic-segl nordic-segl Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PPR inherits permissions from its owner (APP). Therefore, APP must take ownership of led1 (so PPR could use it). Moreover, APP must claim ownership of other resources that PPR will use (spi131, uart135, route interrupts to PPR interrupt handler).

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
* SPDX-License-Identifier: Apache-2.0
*/

#include "nrf54h20dk_nrf54h20_common.dtsi"

&spi131 {
status = "reserved";
interrupt-parent = <&cpuppr_clic>;
};

&uart135 {
status = "reserved";
interrupt-parent = <&cpuppr_clic>;
};
30 changes: 20 additions & 10 deletions samples/boards/nordic/spis_wakeup/sample.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
common:
sysbuild: true
depends_on: spi
tags:
- spi
harness: console
harness_config:
fixture: spi_loopback
type: multi_line
ordered: true
regex:
- ".*SPIS: waiting for SPI transfer"
- ".*SPIS: woken up by"

sample:
name: SPI wakeup sample
tests:
sample.drivers.spis.wakeup:
tags:
- spi
platform_allow:
- nrf54h20dk/nrf54h20/cpuapp
integration_platforms:
- nrf54h20dk/nrf54h20/cpuapp
harness: console
harness_config:
fixture: spi_loopback
type: multi_line
ordered: true
regex:
- ".*SPIS: waiting for SPI transfer"
- ".*SPIS: woken up by"
sample.drivers.spis.wakeup.ppr:
platform_allow:
- nrf54h20dk/nrf54h20/cpuapp
integration_platforms:
- nrf54h20dk/nrf54h20/cpuapp
extra_args:
- SB_CONFIG_REMOTE_NRF54H20_CPUPPR_CORE=y
- spis_wakeup_CONFIG_SOC_NRF54H20_CPURAD_ENABLE=n
- spis_wakeup_SNIPPET=nordic-ppr-xip
- DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_with_cpuppr.overlay"
4 changes: 2 additions & 2 deletions samples/boards/nordic/spis_wakeup/sysbuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
# SPDX-License-Identifier: Apache-2.0
#

if(SB_CONFIG_SOC_NRF54H20)
if(SB_CONFIG_REMOTE_BOARD)
# Add remote project
ExternalZephyrProject_Add(
APPLICATION wakeup_trigger
SOURCE_DIR ${APP_DIR}/wakeup_trigger
BOARD ${SB_CONFIG_BOARD}/${SB_CONFIG_SOC}/cpurad
BOARD ${SB_CONFIG_REMOTE_BOARD}
BOARD_REVISION ${BOARD_REVISION}
)
endif()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move common part for "remote" core to a separate file.

Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* Copyright (c) 2025 Nordic Semiconductor
* SPDX-License-Identifier: Apache-2.0
*/

/ {
aliases {
led = &led1;
};

leds {
compatible = "gpio-leds";
led1: led_1 {
gpios = <&gpio9 1 GPIO_ACTIVE_HIGH>;
label = "Green LED 1";
};
};
};

&gpiote130 {
status = "okay";
owned-channels = <1>;
};

&gpio0 {
status = "okay";
};

&gpio9 {
status = "okay";
};

&pinctrl {
spi131_default_alt: spi131_default_alt {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 1)>,
<NRF_PSEL(SPIM_MOSI, 0, 7)>,
<NRF_PSEL(SPIM_MISO, 0, 9)>;
};
};

spi131_sleep_alt: spi131_sleep_alt {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 1)>,
<NRF_PSEL(SPIM_MOSI, 0, 7)>,
<NRF_PSEL(SPIM_MISO, 0, 9)>;
low-power-enable;
};
};
};

&spi131 {
compatible = "nordic,nrf-spim";
status = "okay";
pinctrl-0 = <&spi131_default_alt>;
pinctrl-1 = <&spi131_sleep_alt>;
pinctrl-names = "default", "sleep";
overrun-character = <0x00>;
cs-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
wake-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
zephyr,pm-device-runtime-auto;
spim_dt: spi-device@0 {
compatible = "vnd,spi-device";
reg = <0>;
spi-max-frequency = <DT_FREQ_M(8)>;
};
};

&uart135 {
zephyr,pm-device-runtime-auto;
};
Copy link
Contributor Author

@nordic-segl nordic-segl Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only to limit code size. Otherwise, sample doesn't fit in available ROM.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_ASSERT=n
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*
* Copyright (c) 2025 Nordic Semiconductor
* SPDX-License-Identifier: Apache-2.0
*/

#include "nrf54h20dk_nrf54h20_common.dtsi"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed from remote core prj.conf because PPR doesn't support CONFIG_PM and binary file is too big when ASSERTS are enabled.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CONFIG_PM=y

CONFIG_ASSERT=y
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Common file plus set memory-regions property in spi131.

Original file line number Diff line number Diff line change
Expand Up @@ -3,70 +3,8 @@
* SPDX-License-Identifier: Apache-2.0
*/

/ {
aliases {
led = &led1;
};

leds {
compatible = "gpio-leds";
led1: led_1 {
gpios = <&gpio9 1 GPIO_ACTIVE_HIGH>;
label = "Green LED 1";
};
};
};

&gpiote130 {
status = "okay";
owned-channels = <1>;
};

&gpio0 {
status = "okay";
};

&gpio9 {
status = "okay";
};

&pinctrl {
spi131_default_alt: spi131_default_alt {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 1)>,
<NRF_PSEL(SPIM_MOSI, 0, 7)>,
<NRF_PSEL(SPIM_MISO, 0, 9)>;
};
};

spi131_sleep_alt: spi131_sleep_alt {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 1)>,
<NRF_PSEL(SPIM_MOSI, 0, 7)>,
<NRF_PSEL(SPIM_MISO, 0, 9)>;
low-power-enable;
};
};
};
#include "nrf54h20dk_nrf54h20_common.dtsi"

&spi131 {
compatible = "nordic,nrf-spim";
status = "okay";
pinctrl-0 = <&spi131_default_alt>;
pinctrl-1 = <&spi131_sleep_alt>;
pinctrl-names = "default", "sleep";
overrun-character = <0x00>;
cs-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
wake-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
zephyr,pm-device-runtime-auto;
memory-regions = <&cpurad_dma_region>;
spim_dt: spi-device@0 {
compatible = "vnd,spi-device";
reg = <0>;
spi-max-frequency = <DT_FREQ_M(8)>;
};
};

&uart135 {
zephyr,pm-device-runtime-auto;
};
3 changes: 0 additions & 3 deletions samples/boards/nordic/spis_wakeup/wakeup_trigger/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ CONFIG_SPI=y
CONFIG_SPI_NRFX_WAKE_TIMEOUT_US=500
CONFIG_GPIO=y

CONFIG_PM=y
CONFIG_PM_DEVICE=y
CONFIG_PM_DEVICE_RUNTIME=y

CONFIG_ASSERT=y

CONFIG_LOG=y