Skip to content

Commit 1071446

Browse files
danieldegrassecarlescufi
authored andcommitted
samples: ipc: openamp: Enable openamp sample for iMX.RT1170 EVK
Enable the openamp sample for RT1170EVK. CM4 core has a custom DTS overlay to use LPUART2 for console information, and use a secondary GPT timer for the system tick. Signed-off-by: Daniel DeGrasse <[email protected]>
1 parent 0f6b725 commit 1071446

File tree

7 files changed

+86
-4
lines changed

7 files changed

+86
-4
lines changed

boards/arm/mimxrt1170_evk/board.cmake

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

7-
if(CONFIG_SOC_MIMXRT1176_CM7)
7+
if(CONFIG_SOC_MIMXRT1176_CM7 OR CONFIG_SECOND_CORE_MCUX)
88
board_runner_args(pyocd "--target=mimxrt1170_cm7")
99
board_runner_args(jlink "--device=MIMXRT1176xxxA_M7" "--reset-after-load")
10-
endif()
11-
12-
if(CONFIG_SOC_MIMXRT1176_CM4)
10+
elseif(CONFIG_SOC_MIMXRT1176_CM4)
1311
board_runner_args(pyocd "--target=mimxrt1170_cm4")
1412
# Note: Please use JLINK above V7.50 (Only support run cm4 image when debugging due to default boot core on board is cm7 core)
1513
board_runner_args(jlink "--device=MIMXRT1176xxxA_M4")

samples/subsys/ipc/openamp/Kconfig.sysbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ string
1010
default "lpcxpresso55s69_cpu1" if $(BOARD) = "lpcxpresso55s69_cpu0"
1111
default "mps2_an521_remote" if $(BOARD) = "mps2_an521"
1212
default "v2m_musca_b1_ns" if $(BOARD) = "v2m_musca_b1"
13+
default "mimxrt1170_evk_cm4" if $(BOARD) = "mimxrt1170_evk_cm7"

samples/subsys/ipc/openamp/README.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ Building the application for v2m_musca_b1
4343
:board: v2m_musca_b1
4444
:goals: debug
4545

46+
Building the application for mimxrt1170_evk_cm7
47+
***********************************************
48+
49+
.. zephyr-app-commands::
50+
:zephyr-app: samples/subsys/ipc/openamp
51+
:board: mimxrt1170_evk_cm7
52+
:goals: debug
53+
4654
Open a serial terminal (minicom, putty, etc.) and connect the board with the
4755
following settings:
4856

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CONFIG_INCLUDE_REMOTE_DIR=y
2+
CONFIG_SECOND_CORE_MCUX=y
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2022 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
chosen {
9+
zephyr,ipc_shm = &ocram2_overlay;
10+
};
11+
12+
/* OpenAMP fails with full 512K OCRAM2 memory region as shared memory.
13+
* Define a subset of the OCRAM2 region for demo to use
14+
* Note that shared memory must have specific MPU attributes set.
15+
*/
16+
ocram2_overlay: memory@202c0000{
17+
compatible = "zephyr,memory-region", "mmio-sram";
18+
reg = <0x202c0000 DT_SIZE_K(16)>;
19+
zephyr,memory-region="OCRAM2_OVERLAY";
20+
zephyr,memory-region-mpu = "IO";
21+
};
22+
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CONFIG_BUILD_OUTPUT_INFO_HEADER=y
2+
CONFIG_BUILD_OUTPUT_HEX=y
3+
CONFIG_SECOND_CORE_MCUX=y
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* Copyright (c) 2022 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
/* Switch to lpuart2, since primary core uses lpuart1 */
9+
chosen {
10+
zephyr,console = &lpuart2;
11+
zephyr,shell-uart = &lpuart2;
12+
zephyr,ipc_shm = &ocram2_overlay;
13+
};
14+
15+
soc {
16+
/delete-node/ gpt@400f0000;
17+
18+
/* Replace GPT2 with another GPT kernel timer */
19+
gpt2_hw_timer:gpt@400f0000 {
20+
compatible = "nxp,gpt-hw-timer";
21+
reg = <0x400f0000 0x4000>;
22+
interrupts = <120 0>;
23+
status = "okay";
24+
};
25+
};
26+
27+
/* OpenAMP fails with full 512K OCRAM2 memory region as shared memory.
28+
* Define a subset of the OCRAM2 region for demo to use
29+
* Note that shared memory must have specific MPU attributes set
30+
*/
31+
ocram2_overlay: memory@202c0000 {
32+
compatible = "zephyr,memory-region", "mmio-sram";
33+
reg = <0x202c0000 DT_SIZE_K(16)>;
34+
zephyr,memory-region="OCRAM2_OVERLAY";
35+
zephyr,memory-region-mpu = "IO";
36+
};
37+
};
38+
39+
/* Enable secondary LPUART */
40+
&lpuart2 {
41+
status = "okay";
42+
current-speed = <115200>;
43+
};
44+
45+
/* Disable primary GPT timer */
46+
&gpt_hw_timer {
47+
status = "disabled";
48+
};

0 commit comments

Comments
 (0)