Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

samples: zephyr: drivers: mbox: Enable sample on nRF54L09 and L20 #21051

Merged
Merged
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
2 changes: 2 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,7 @@
/samples/zephyr/drivers/adc/ @nrfconnect/ncs-low-level-test
/samples/zephyr/drivers/audio/dmic/ @nrfconnect/ncs-low-level-test
/samples/zephyr/drivers/i2c/rtio_loopback/ @nrfconnect/ncs-low-level-test
/samples/zephyr/drivers/mbox/ @nrfconnect/ncs-low-level-test
/samples/zephyr/drivers/watchdog/ @nrfconnect/ncs-low-level-test
/samples/zephyr/sensor/accel_polling/ @nrfconnect/ncs-low-level-test
/samples/zephyr/sensor/bme680/ @nrfconnect/ncs-low-level-test
Expand Down Expand Up @@ -933,6 +934,7 @@
/tests/zephyr/drivers/mspi/api/ @nrfconnect/ncs-low-level-test @nrfconnect/ncs-ll-ursus
/tests/zephyr/boards/nrf/ @nrfconnect/ncs-low-level-test
/tests/zephyr/drivers/spi/ @nrfconnect/ncs-low-level-test
/tests/zephyr/drivers/timer/ @nrfconnect/ncs-low-level-test
/tests/zephyr/drivers/uart/ @nrfconnect/ncs-low-level-test
/tests/zephyr/drivers/watchdog/ @nrfconnect/ncs-low-level-test

Expand Down
30 changes: 30 additions & 0 deletions samples/zephyr/drivers/mbox/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
# Copyright (c) 2025 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

set(REMOTE_ZEPHYR_DIR ${CMAKE_CURRENT_BINARY_DIR}/../remote/zephyr)

if(CONFIG_BOARD_NRF54L09PDK_NRF54L09_CPUAPP OR
CONFIG_BOARD_NRF54L20PDK_NRF54L20_CPUAPP)
message(STATUS "${BOARD}${BOARD_QUALIFIERS} compile as Main in this sample")
else()
message(FATAL_ERROR "${BOARD}${BOARD_QUALIFIERS} is not supported for this sample")
endif()

Copy link
Contributor

Choose a reason for hiding this comment

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

error out if sysbuild needed and not used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, added.

if(NOT SYSBUILD)
message(FATAL_ERROR
" This is a multi-image application that should be built using sysbuild.\n"
" Add --sysbuild argument to west build command to prepare all the images.")
endif()

project(mbox_ipc)

enable_language(C ASM)

target_sources(app PRIVATE ${ZEPHYR_BASE}/samples/drivers/mbox/src/main.c)
1 change: 1 addition & 0 deletions samples/zephyr/drivers/mbox/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
source "samples/drivers/mbox/Kconfig"
12 changes: 12 additions & 0 deletions samples/zephyr/drivers/mbox/Kconfig.sysbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# Copyright (c) 2025 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

source "share/sysbuild/Kconfig"

config REMOTE_BOARD
string "Remote board"
default "nrf54l09pdk/nrf54l09/cpuflpr" if $(BOARD) = "nrf54l09pdk"
default "nrf54l20pdk/nrf54l20/cpuflpr" if $(BOARD) = "nrf54l20pdk"
3 changes: 3 additions & 0 deletions samples/zephyr/drivers/mbox/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This sample extends the same-named Zephyr sample to verify it with Nordic development kits.

Source code and basic configuration files can be found in the corresponding folder structure in zephyr/samples/drivers/mbox.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright 2025 Nordic Semiconductor ASA
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
mbox-consumer {
compatible = "vnd,mbox-consumer";
mboxes = <&cpuapp_vevif_rx 20>, <&cpuapp_vevif_tx 21>;
mbox-names = "rx", "tx";
};
};

&cpuapp_vevif_rx {
status = "okay";
};

&cpuapp_vevif_tx {
status = "okay";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright 2025 Nordic Semiconductor ASA
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
mbox-consumer {
compatible = "vnd,mbox-consumer";
mboxes = <&cpuapp_vevif_rx 20>, <&cpuapp_vevif_tx 21>;
mbox-names = "rx", "tx";
};
};

&cpuapp_vevif_rx {
status = "okay";
};

&cpuapp_vevif_tx {
status = "okay";
};
2 changes: 2 additions & 0 deletions samples/zephyr/drivers/mbox/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_PRINTK=y
CONFIG_MBOX=y
21 changes: 21 additions & 0 deletions samples/zephyr/drivers/mbox/remote/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# Copyright (c) 2021 Carlo Caione <ccaione@baylibre.com>
# Copyright 2023-2025 NXP
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

if(CONFIG_BOARD_NRF54L09PDK_NRF54L09_CPUFLPR OR
CONFIG_BOARD_NRF54L20PDK_NRF54L20_CPUFLPR)
message(STATUS "${BOARD}${BOARD_QUALIFIERS} compile as remote in this sample")
else()
message(FATAL_ERROR "${BOARD}${BOARD_QUALIFIERS} is not supported for this sample")
endif()

project(mbox_ipc_remote)

target_sources(app PRIVATE ${ZEPHYR_BASE}/samples/drivers/mbox/remote/src/main.c)
1 change: 1 addition & 0 deletions samples/zephyr/drivers/mbox/remote/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
source "samples/drivers/mbox/remote/Kconfig"
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright 2025 Nordic Semiconductor ASA
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
mbox-consumer {
compatible = "vnd,mbox-consumer";
mboxes = <&cpuflpr_vevif_rx 21>, <&cpuflpr_vevif_tx 20>;
mbox-names = "rx", "tx";
};
};

&cpuflpr_vevif_rx {
status = "okay";
};

&cpuflpr_vevif_tx {
status = "okay";
};

&uart30 {
/delete-property/ hw-flow-control;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright 2025 Nordic Semiconductor ASA
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
mbox-consumer {
compatible = "vnd,mbox-consumer";
mboxes = <&cpuflpr_vevif_rx 21>, <&cpuflpr_vevif_tx 20>;
mbox-names = "rx", "tx";
};
};

&cpuflpr_vevif_rx {
status = "okay";
};

&cpuflpr_vevif_tx {
status = "okay";
};

&uart30 {
/delete-property/ hw-flow-control;
};
2 changes: 2 additions & 0 deletions samples/zephyr/drivers/mbox/remote/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_STDOUT_CONSOLE=n
CONFIG_MBOX=y
61 changes: 61 additions & 0 deletions samples/zephyr/drivers/mbox/sample.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
sample:
name: MBOX IPC sample
common:
sysbuild: true
tags:
- mbox
- ci_samples_zephyr_drivers_mbox
timeout: 30
tests:
nrf.extended.sample.drivers.mbox.nrf54l:
platform_allow:
- nrf54l09pdk/nrf54l09/cpuapp
- nrf54l20pdk/nrf54l20/cpuapp
integration_platforms:
- nrf54l20pdk/nrf54l20/cpuapp
extra_args: mbox_SNIPPET=nordic-flpr
sysbuild: true
harness: console
harness_config:
type: multi_line
ordered: false
regex:
- "Ping \\(on channel 21\\)"
- "Pong \\(on channel 20\\)"

nrf.extended.sample.drivers.mbox.nrf54l_no_multithreading:
platform_allow:
- nrf54l09pdk/nrf54l09/cpuapp
- nrf54l20pdk/nrf54l20/cpuapp
integration_platforms:
- nrf54l20pdk/nrf54l20/cpuapp
extra_args:
- mbox_SNIPPET=nordic-flpr
- mbox_CONFIG_MULTITHREADING=n
- remote_CONFIG_MULTITHREADING=n
sysbuild: true
harness: console
harness_config:
type: multi_line
ordered: false
regex:
- "Ping \\(on channel 21\\)"
- "Pong \\(on channel 20\\)"

nrf.extended.sample.drivers.mbox.nrf54l_remote_no_multithreading:
platform_allow:
- nrf54l09pdk/nrf54l09/cpuapp
- nrf54l20pdk/nrf54l20/cpuapp
integration_platforms:
- nrf54l20pdk/nrf54l20/cpuapp
extra_args:
- mbox_SNIPPET=nordic-flpr
- remote_CONFIG_MULTITHREADING=n
sysbuild: true
harness: console
harness_config:
type: multi_line
ordered: false
regex:
- "Ping \\(on channel 21\\)"
- "Pong \\(on channel 20\\)"
19 changes: 19 additions & 0 deletions samples/zephyr/drivers/mbox/sysbuild.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#
# Copyright (c) 2025 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

if("${SB_CONFIG_REMOTE_BOARD}" STREQUAL "")
message(FATAL_ERROR
"Target ${BOARD}${BOARD_QUALIFIERS} not supported for this sample. "
"There is no remote board selected in Kconfig.sysbuild")
endif()

set(REMOTE_APP remote)

ExternalZephyrProject_Add(
APPLICATION ${REMOTE_APP}
SOURCE_DIR ${APP_DIR}/${REMOTE_APP}
BOARD ${SB_CONFIG_REMOTE_BOARD}
)
1 change: 1 addition & 0 deletions samples/zephyr/drivers/mbox/sysbuild.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SB_CONFIG_PARTITION_MANAGER=n
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
&wdt31 {
status = "okay";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
&wdt31 {
status = "okay";
};
2 changes: 2 additions & 0 deletions samples/zephyr/drivers/watchdog/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ tests:
nrf.extended.sample.drivers.watchdog:
platform_allow:
- nrf54l09pdk/nrf54l09/cpuapp
- nrf54l09pdk/nrf54l09/cpuflpr
- nrf54l20pdk/nrf54l20/cpuflpr
integration_platforms:
- nrf54l09pdk/nrf54l09/cpuapp
10 changes: 10 additions & 0 deletions scripts/ci/tags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1519,6 +1519,11 @@ ci_samples_zephyr_drivers_i2c:
- nrf/samples/zephyr/drivers/i2c/
- zephyr/samples/drivers/i2c/

ci_samples_zephyr_drivers_mbox:
files:
- nrf/samples/zephyr/drivers/mbox/
- zephyr/samples/drivers/mbox/

ci_samples_zephyr_boards_nordic_system_off:
files:
- nrf/samples/zephyr/boards/nordic/system_off/
Expand Down Expand Up @@ -1569,6 +1574,11 @@ ci_samples_zephyr_drivers_adc:
- nrf/samples/zephyr/drivers/adc/
- zephyr/samples/drivers/adc/

ci_tests_zephyr_drivers_timer:
files:
- nrf/tests/zephyr/drivers/timer/
- zephyr/tests/drivers/timer/

ci_samples_zephyr_subsys_usb:
files:
- nrf/samples/zephyr/subsys/usb/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/ {
aliases {
qdec0 = &qdec20;
qenca = &phase_a;
qencb = &phase_b;
};

encoder-emulate {
compatible = "gpio-leds";
phase_a: phase_a {
gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
};
phase_b: phase_b {
gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
};
};
};

&pinctrl {
qdec_pinctrl: qdec_pinctrl {
group1 {
psels = <NRF_PSEL(QDEC_A, 1, 8)>,
<NRF_PSEL(QDEC_B, 1, 10)>;
};
};

qdec_sleep_pinctrl: qdec_sleep_pinctrl {
group1 {
psels = <NRF_PSEL(QDEC_A, 1, 8)>,
<NRF_PSEL(QDEC_B, 1, 10)>;
low-power-enable;
};
};
};

&gpio1 {
status = "okay";
};

&qdec20 {
status = "okay";
pinctrl-0 = <&qdec_pinctrl>;
pinctrl-1 = <&qdec_sleep_pinctrl>;
pinctrl-names = "default", "sleep";
steps = <127>;
led-pre = <500>;
zephyr,pm-device-runtime-auto;
};
Loading