Skip to content

Commit

Permalink
samples: enable multicore samples for MCXN947 board
Browse files Browse the repository at this point in the history
This commit adds support for these multicore samples:
- samples/drivers/mbox
- samples/drivers/mbox_data
- samples/subsys/ipc/ipc_service/static_vrings
- samples/subsys/ipc/openamp

Signed-off-by: Tomas Galbicka <[email protected]>
  • Loading branch information
TomasGalbickaNXP authored and kartben committed Jan 15, 2025
1 parent d8ab813 commit 64585b7
Show file tree
Hide file tree
Showing 32 changed files with 260 additions and 2 deletions.
1 change: 1 addition & 0 deletions samples/drivers/mbox/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ if(CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP OR
CONFIG_BOARD_MIMXRT1170_EVK_MIMXRT1176_CM7 OR
CONFIG_BOARD_MIMXRT1160_EVK_MIMXRT1166_CM7 OR
CONFIG_BOARD_LPCXPRESSO55S69_LPC55S69_CPU0 OR
CONFIG_BOARD_FRDM_MCXN947_MCXN947_CPU0 OR
CONFIG_BOARD_ESP32_DEVKITC_WROOM_ESP32_PROCPU OR
CONFIG_BOARD_ESP32S3_DEVKITM_ESP32S3_PROCPU OR
CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP OR
Expand Down
1 change: 1 addition & 0 deletions samples/drivers/mbox/Kconfig.sysbuild
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ config REMOTE_BOARD
default "mimxrt1170_evk/mimxrt1176/cm4" if $(BOARD) = "mimxrt1170_evk"
default "mimxrt1160_evk/mimxrt1166/cm4" if $(BOARD) = "mimxrt1160_evk"
default "lpcxpresso55s69/lpc55s69/cpu1" if $(BOARD) = "lpcxpresso55s69"
default "frdm_mcxn947/mcxn947/cpu1" if $(BOARD) = "frdm_mcxn947"
default "nrf54h20dk/nrf54h20/cpuapp" if "$(BOARD)${BOARD_QUALIFIERS}" = "nrf54h20dk/nrf54h20/cpurad"
default "nrf54l15dk/nrf54l15/cpuflpr" if $(BOARD) = "nrf54l15dk"
default "stm32h747i_disco/stm32h747xx/m4" if $(BOARD) = "stm32h747i_disco"
Expand Down
1 change: 1 addition & 0 deletions samples/drivers/mbox/boards/frdm_mcxn947_mcxn947_cpu0.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_SECOND_CORE_MCUX=y
13 changes: 13 additions & 0 deletions samples/drivers/mbox/boards/frdm_mcxn947_mcxn947_cpu0.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

/ {
mbox-consumer {
compatible = "vnd,mbox-consumer";
mboxes = <&mbox 1>, <&mbox 0>;
mbox-names = "tx", "rx";
};
};
1 change: 1 addition & 0 deletions samples/drivers/mbox/remote/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ if(CONFIG_BOARD_NRF5340DK_NRF5340_CPUNET OR
CONFIG_BOARD_MIMXRT1170_EVK_MIMXRT1176_CM4 OR
CONFIG_BOARD_MIMXRT1160_EVK_MIMXRT1166_CM4 OR
CONFIG_BOARD_LPCXPRESSO55S69_LPC55S69_CPU1 OR
CONFIG_BOARD_FRDM_MCXN947_MCXN947_CPU1 OR
CONFIG_BOARD_ESP32_DEVKITC_WROOM_ESP32_APPCPU OR
CONFIG_BOARD_ESP32S3_DEVKITM_ESP32S3_APPCPU OR
CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUPPR OR
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_SECOND_CORE_MCUX=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

/ {
mbox-consumer {
compatible = "vnd,mbox-consumer";
mboxes = <&mbox 0>, <&mbox 1>;
mbox-names = "tx", "rx";
};
};
1 change: 1 addition & 0 deletions samples/drivers/mbox/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ tests:
- mimxrt1170_evk/mimxrt1176/cm7
- mimxrt1160_evk/mimxrt1166/cm7
- lpcxpresso55s69/lpc55s69/cpu0
- frdm_mcxn947/mcxn947/cpu0
integration_platforms:
- nrf5340dk/nrf5340/cpuapp
harness: console
Expand Down
1 change: 1 addition & 0 deletions samples/drivers/mbox_data/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ set(REMOTE_ZEPHYR_DIR ${CMAKE_CURRENT_BINARY_DIR}/../remote/zephyr)

if(CONFIG_BOARD_MIMXRT1170_EVK_MIMXRT1176_CM7 OR
CONFIG_BOARD_MIMXRT1160_EVK_MIMXRT1166_CM7 OR
CONFIG_BOARD_FRDM_MCXN947_MCXN947_CPU0 OR
CONFIG_BOARD_LPCXPRESSO55S69_LPC55S69_CPU0)
message(STATUS "${BOARD}${BOARD_QUALIFIERS} compile as Main in this sample")
else()
Expand Down
1 change: 1 addition & 0 deletions samples/drivers/mbox_data/Kconfig.sysbuild
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ string
default "mimxrt1170_evk/mimxrt1176/cm4" if $(BOARD) = "mimxrt1170_evk"
default "mimxrt1160_evk/mimxrt1166/cm4" if $(BOARD) = "mimxrt1160_evk"
default "lpcxpresso55s69/lpc55s69/cpu1" if $(BOARD) = "lpcxpresso55s69"
default "frdm_mcxn947/mcxn947/cpu1" if $(BOARD) = "frdm_mcxn947"
9 changes: 9 additions & 0 deletions samples/drivers/mbox_data/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ Building the application for lpcxpresso55s69_cpu1
:goals: debug
:west-args: --sysbuild

Building the application for frdm_mcxn947/mcxn947/cpu0
======================================================

.. zephyr-app-commands::
:zephyr-app: samples/drivers/mbox_data/
:board: frdm_mcxn947/mcxn947/cpu0
:goals: debug
:west-args: --sysbuild

Sample Output
=============

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_SECOND_CORE_MCUX=y
13 changes: 13 additions & 0 deletions samples/drivers/mbox_data/boards/frdm_mcxn947_mcxn947_cpu0.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

/ {
mbox-consumer {
compatible = "vnd,mbox-consumer";
mboxes = <&mbox 1>, <&mbox 0>;
mbox-names = "tx", "rx";
};
};
1 change: 1 addition & 0 deletions samples/drivers/mbox_data/remote/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

if(CONFIG_BOARD_MIMXRT1170_EVK_MIMXRT1176_CM4 OR
CONFIG_BOARD_MIMXRT1160_EVK_MIMXRT1166_CM4 OR
CONFIG_BOARD_FRDM_MCXN947_MCXN947_CPU1 OR
CONFIG_BOARD_LPCXPRESSO55S69_LPC55S69_CPU1)
message(STATUS "${BOARD}${BOARD_QUALIFIERS} compile as remote in this sample")
else()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_SECOND_CORE_MCUX=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

/ {
mbox-consumer {
compatible = "vnd,mbox-consumer";
mboxes = <&mbox 0>, <&mbox 1>;
mbox-names = "tx", "rx";
};
};
1 change: 1 addition & 0 deletions samples/drivers/mbox_data/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ tests:
- mimxrt1170_evk/mimxrt1176/cm7
- mimxrt1160_evk/mimxrt1166/cm7
- lpcxpresso55s69/lpc55s69/cpu0
- frdm_mcxn947/mcxn947/cpu0
integration_platforms:
- mimxrt1160_evk/mimxrt1166/cm7
- lpcxpresso55s69/lpc55s69/cpu0
Expand Down
3 changes: 2 additions & 1 deletion samples/subsys/ipc/ipc_service/static_vrings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ if(NOT (CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP OR
CONFIG_BOARD_NRF5340BSIM_NRF5340_CPUAPP OR
CONFIG_BOARD_LPCXPRESSO55S69_LPC55S69_CPU0 OR
CONFIG_BOARD_MIMXRT1160_EVK_MIMXRT1166_CM7 OR
CONFIG_BOARD_MIMXRT1170_EVK_MIMXRT1176_CM7
CONFIG_BOARD_MIMXRT1170_EVK_MIMXRT1176_CM7 OR
CONFIG_BOARD_FRDM_MCXN947_MCXN947_CPU0
)
)
message(FATAL_ERROR "${BOARD} is not supported for this sample")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ string
default "mimxrt1160_evk/mimxrt1166/cm4" if $(BOARD) = "mimxrt1160_evk"
default "mimxrt1170_evk/mimxrt1176/cm4" if $(BOARD) = "mimxrt1170_evk"
default "mimxrt1170_evkb/mimxrt1176/cm4" if $(BOARD) = "mimxrt1170_evkb"
default "frdm_mcxn947/mcxn947/cpu1" if $(BOARD) = "frdm_mcxn947"
9 changes: 9 additions & 0 deletions samples/subsys/ipc/ipc_service/static_vrings/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ Building the application for mimxrt1170_evk@B/mimxrt1176/cm7
:goals: debug
:west-args: --sysbuild

Building the application for frdm_mcxn947/mcxn947/cpu0
************************************************************

.. zephyr-app-commands::
:zephyr-app: samples/subsys/ipc/ipc_service/static_vrings
:board: frdm_mcxn947/mcxn947/cpu0
:goals: debug
:west-args: --sysbuild

Open a serial terminal (minicom, putty, etc.) and connect the board with the
following settings:

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_SECOND_CORE_MCUX=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/ipc_service/static_vrings.h>
#include <zephyr/dt-bindings/memory-attr/memory-attr-arm.h>

/ {
/* Define memory regions for IPC
* Note that shared memory must have specific MPU attributes set.
*/
sram1_ipc0: memory@20060000{
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0x20060000 DT_SIZE_K(16)>;
zephyr,memory-region="SRAM1_IPC0";
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_IO))>;
};

sram1_ipc1: memory@20064000{
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0x20064000 DT_SIZE_K(16)>;
zephyr,memory-region="SRAM1_IPC1";
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_IO))>;
};

ipc {
/delete-node/ ipc0;

ipc0: ipc0 {
compatible = "zephyr,ipc-openamp-static-vrings";
memory-region = <&sram1_ipc0>;
mboxes = <&mbox 0>, <&mbox 1>;
mbox-names = "tx", "rx";
role = "host";
status = "okay";
};

ipc1: ipc1 {
compatible = "zephyr,ipc-openamp-static-vrings";
memory-region = <&sram1_ipc1>;
mboxes = <&mbox 2>, <&mbox 3>;
mbox-names = "tx", "rx";
role = "host";
zephyr,priority = <1 PRIO_COOP>;
zephyr,buffer-size = <128>;
status = "okay";
};
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_SECOND_CORE_MCUX=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/ipc_service/static_vrings.h>
#include <zephyr/dt-bindings/memory-attr/memory-attr-arm.h>

/ {
/* Define memory regions for IPC
* Note that shared memory must have specific MPU attributes set.
*/
sram1_ipc0: memory@20060000{
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0x20060000 DT_SIZE_K(16)>;
zephyr,memory-region="SRAM1_IPC0";
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_IO))>;
};

sram1_ipc1: memory@20064000{
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0x20064000 DT_SIZE_K(16)>;
zephyr,memory-region="SRAM1_IPC1";
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_IO))>;
};

ipc {
/delete-node/ ipc0;

ipc0: ipc0 {
compatible = "zephyr,ipc-openamp-static-vrings";
memory-region = <&sram1_ipc0>;
mboxes = <&mbox 0>, <&mbox 1>;
mbox-names = "rx", "tx";
role = "remote";
status = "okay";
};

ipc1: ipc1 {
compatible = "zephyr,ipc-openamp-static-vrings";
memory-region = <&sram1_ipc1>;
mboxes = <&mbox 2>, <&mbox 3>;
mbox-names = "rx", "tx";
role = "remote";
zephyr,priority = <1 PRIO_COOP>;
zephyr,buffer-size = <128>;
status = "okay";
};
};
};
1 change: 1 addition & 0 deletions samples/subsys/ipc/ipc_service/static_vrings/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ tests:
- mimxrt1160_evk/mimxrt1166/cm7
- mimxrt1170_evk/mimxrt1176/cm7
- mimxrt1170_evk@B/mimxrt1176/cm7
- frdm_mcxn947/mcxn947/cpu0
integration_platforms:
- nrf5340dk/nrf5340/cpuapp
- nrf5340bsim/nrf5340/cpuapp
Expand Down
3 changes: 2 additions & 1 deletion samples/subsys/ipc/openamp/Kconfig.sysbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022-2023 NXP
# Copyright 2022-2024 NXP
#
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -13,3 +13,4 @@ string
default "mimxrt1170_evk/mimxrt1176/cm4" if $(BOARD) = "mimxrt1170_evk"
default "mimxrt1160_evk/mimxrt1166/cm4" if $(BOARD) = "mimxrt1160_evk"
default "mimxrt1170_evkb/mimxrt1176/cm4" if $(BOARD) = "mimxrt1170_evkb"
default "frdm_mcxn947/mcxn947/cpu1" if $(BOARD) = "frdm_mcxn947"
9 changes: 9 additions & 0 deletions samples/subsys/ipc/openamp/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ Building the application for mimxrt1170_evk_cm7
:goals: debug
:west-args: --sysbuild

Building the application for frdm_mcxn947/mcxn947/cpu0
******************************************************

.. zephyr-app-commands::
:zephyr-app: samples/subsys/ipc/openamp
:board: frdm_mcxn947/mcxn947/cpu0
:goals: debug
:west-args: --sysbuild

Open a serial terminal (minicom, putty, etc.) and connect the board with the
following settings:

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_SECOND_CORE_MCUX=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

/ {
chosen {
/*
* shared memory reserved for the inter-processor communication
*/

zephyr,ipc_shm = &sramh;
zephyr,ipc = &mailbox0;
};

/* Delete MBOX Driver node */
/delete-node/ mbox@b2000;
soc {
mailbox0:mailbox@400b2000 {
compatible = "nxp,lpc-mailbox";
reg = <0x400b2000 0xEC>;
interrupts = <54 0>;
resets = <&reset NXP_SYSCON_RESET(0, 26)>;
status = "okay";
};
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_SECOND_CORE_MCUX=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

/ {
chosen {
/*
* shared memory reserved for the inter-processor communication
*/

zephyr,ipc_shm = &sramh;
zephyr,ipc = &mailbox0;
};

/* Delete MBOX Driver node */
/delete-node/ mbox@b2000;
soc {
mailbox0:mailbox@400b2000 {
compatible = "nxp,lpc-mailbox";
reg = <0x400b2000 0xEC>;
interrupts = <54 0>;
resets = <&reset NXP_SYSCON_RESET(0, 26)>;
status = "okay";
};
};
};
1 change: 1 addition & 0 deletions samples/subsys/ipc/openamp/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tests:
platform_allow:
- lpcxpresso54114/lpc54114/m4
- lpcxpresso55s69/lpc55s69/cpu0
- frdm_mcxn947/mcxn947/cpu0
- mps2/an521/cpu0
- v2m_musca_b1/musca_b1
integration_platforms:
Expand Down

0 comments on commit 64585b7

Please sign in to comment.