Skip to content

Commit 0e6a886

Browse files
uLipecarlescufi
authored andcommitted
samples: subsys: ipc: add esp32 as supported board
to the rpmsg service sample. Signed-off-by: Felipe Neves <[email protected]>
1 parent bd705e6 commit 0e6a886

File tree

6 files changed

+51
-1
lines changed

6 files changed

+51
-1
lines changed

samples/subsys/ipc/rpmsg_service/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ elseif("${BOARD}" STREQUAL "mps2_an521")
1818
set(BOARD_REMOTE "mps2_an521_remote")
1919
elseif("${BOARD}" STREQUAL "v2m_musca_b1")
2020
set(BOARD_REMOTE "v2m_musca_b1_ns")
21+
elseif("${BOARD}" STREQUAL "esp32")
22+
set(BOARD_REMOTE "esp32_net")
2123
else()
2224
message(FATAL_ERROR "${BOARD} was not supported for this sample")
2325
endif()
@@ -31,6 +33,11 @@ enable_language(C ASM)
3133

3234
target_sources(app PRIVATE src/main.c)
3335

36+
if("${BOARD}" STREQUAL "esp32")
37+
set_source_files_properties(${REMOTE_ZEPHYR_DIR}/esp32_net_firmware.c PROPERTIES GENERATED TRUE)
38+
target_sources(app PRIVATE src/main.c ${REMOTE_ZEPHYR_DIR}/esp32_net_firmware.c)
39+
endif()
40+
3441
include(ExternalProject)
3542

3643
ExternalProject_Add(
@@ -45,6 +52,8 @@ ExternalProject_Add(
4552

4653
if(("${BOARD}" STREQUAL "lpcxpresso54114_m4"))
4754
add_dependencies(core_m0_inc_target rpmsg_service_remote)
55+
elseif("${BOARD}" STREQUAL "esp32")
56+
add_dependencies(app rpmsg_service_remote)
4857
endif()
4958

5059
target_include_directories(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_ESP32_NETWORK_CORE=y
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright (c) 2023 Felipe Neves <[email protected]>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
chosen {
9+
/*
10+
* shared memory reserved for the inter-processor communication
11+
*/
12+
zephyr,ipc_shm = &shm0;
13+
zephyr,ipc = &ipm0;
14+
};
15+
};
16+
17+
&ipm0 {
18+
status = "okay";
19+
};

samples/subsys/ipc/rpmsg_service/remote/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ if("${BOARD}" STREQUAL "nrf5340dk_nrf5340_cpunet"
99
OR "${BOARD}" STREQUAL "bl5340_dvk_cpunet"
1010
OR "${BOARD}" STREQUAL "lpcxpresso54114_m0"
1111
OR "${BOARD}" STREQUAL "mps2_an521_remote"
12-
OR "${BOARD}" STREQUAL "v2m_musca_b1_ns")
12+
OR "${BOARD}" STREQUAL "v2m_musca_b1_ns"
13+
OR "${BOARD}" STREQUAL "esp32_net")
1314
message(STATUS "${BOARD} compile as slave in this sample")
1415
else()
1516
message(FATAL_ERROR "${BOARD} was not supported for this sample")
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_KERNEL_BIN_NAME="esp32_net_firmware"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright (c) 2023 Felipe Neves <[email protected]>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
chosen {
9+
/*
10+
* shared memory reserved for the inter-processor communication
11+
*/
12+
zephyr,ipc_shm = &shm0;
13+
zephyr,ipc = &ipm0;
14+
};
15+
};
16+
17+
&ipm0 {
18+
status = "okay";
19+
};

0 commit comments

Comments
 (0)