Skip to content

Commit

Permalink
samples: subsys: ipc: add esp32 as supported board
Browse files Browse the repository at this point in the history
to the rpmsg service sample.

Signed-off-by: Felipe Neves <ryukokki.felipe@gmail.com>
  • Loading branch information
uLipe authored and carlescufi committed Mar 16, 2023
1 parent bd705e6 commit 0e6a886
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 1 deletion.
9 changes: 9 additions & 0 deletions samples/subsys/ipc/rpmsg_service/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ elseif("${BOARD}" STREQUAL "mps2_an521")
set(BOARD_REMOTE "mps2_an521_remote")
elseif("${BOARD}" STREQUAL "v2m_musca_b1")
set(BOARD_REMOTE "v2m_musca_b1_ns")
elseif("${BOARD}" STREQUAL "esp32")
set(BOARD_REMOTE "esp32_net")
else()
message(FATAL_ERROR "${BOARD} was not supported for this sample")
endif()
Expand All @@ -31,6 +33,11 @@ enable_language(C ASM)

target_sources(app PRIVATE src/main.c)

if("${BOARD}" STREQUAL "esp32")
set_source_files_properties(${REMOTE_ZEPHYR_DIR}/esp32_net_firmware.c PROPERTIES GENERATED TRUE)
target_sources(app PRIVATE src/main.c ${REMOTE_ZEPHYR_DIR}/esp32_net_firmware.c)
endif()

include(ExternalProject)

ExternalProject_Add(
Expand All @@ -45,6 +52,8 @@ ExternalProject_Add(

if(("${BOARD}" STREQUAL "lpcxpresso54114_m4"))
add_dependencies(core_m0_inc_target rpmsg_service_remote)
elseif("${BOARD}" STREQUAL "esp32")
add_dependencies(app rpmsg_service_remote)
endif()

target_include_directories(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
1 change: 1 addition & 0 deletions samples/subsys/ipc/rpmsg_service/boards/esp32.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_ESP32_NETWORK_CORE=y
19 changes: 19 additions & 0 deletions samples/subsys/ipc/rpmsg_service/boards/esp32.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (c) 2023 Felipe Neves <ryukokki.felipe@gmail.com>
*
* SPDX-License-Identifier: Apache-2.0
*/

/ {
chosen {
/*
* shared memory reserved for the inter-processor communication
*/
zephyr,ipc_shm = &shm0;
zephyr,ipc = &ipm0;
};
};

&ipm0 {
status = "okay";
};
3 changes: 2 additions & 1 deletion samples/subsys/ipc/rpmsg_service/remote/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ if("${BOARD}" STREQUAL "nrf5340dk_nrf5340_cpunet"
OR "${BOARD}" STREQUAL "bl5340_dvk_cpunet"
OR "${BOARD}" STREQUAL "lpcxpresso54114_m0"
OR "${BOARD}" STREQUAL "mps2_an521_remote"
OR "${BOARD}" STREQUAL "v2m_musca_b1_ns")
OR "${BOARD}" STREQUAL "v2m_musca_b1_ns"
OR "${BOARD}" STREQUAL "esp32_net")
message(STATUS "${BOARD} compile as slave in this sample")
else()
message(FATAL_ERROR "${BOARD} was not supported for this sample")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_KERNEL_BIN_NAME="esp32_net_firmware"
19 changes: 19 additions & 0 deletions samples/subsys/ipc/rpmsg_service/remote/boards/esp32_net.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (c) 2023 Felipe Neves <ryukokki.felipe@gmail.com>
*
* SPDX-License-Identifier: Apache-2.0
*/

/ {
chosen {
/*
* shared memory reserved for the inter-processor communication
*/
zephyr,ipc_shm = &shm0;
zephyr,ipc = &ipm0;
};
};

&ipm0 {
status = "okay";
};

0 comments on commit 0e6a886

Please sign in to comment.