From 568f499737c0595a9f051fe739aabac9feedda6b Mon Sep 17 00:00:00 2001 From: Marek Matej Date: Tue, 19 Nov 2024 15:33:43 +0000 Subject: [PATCH] samples: driver: ipm: esp32 sysbuild refactor Make APP_CPU board name auto generated and remove the related config. Remove the boards overlay and replace with a socs overlays. Signed-off-by: Marek Matej --- samples/drivers/ipm/ipm_esp32/Kconfig.sysbuild | 6 ------ .../ipm_esp32/boards/esp32s3_devkitm_procpu.overlay | 3 --- .../ipm/ipm_esp32/boards/yd_esp32_procpu.overlay | 3 --- samples/drivers/ipm/ipm_esp32/src/procpu_shell.c | 3 +++ samples/drivers/ipm/ipm_esp32/sysbuild.cmake | 11 ++++++++++- 5 files changed, 13 insertions(+), 13 deletions(-) delete mode 100644 samples/drivers/ipm/ipm_esp32/boards/esp32s3_devkitm_procpu.overlay delete mode 100644 samples/drivers/ipm/ipm_esp32/boards/yd_esp32_procpu.overlay diff --git a/samples/drivers/ipm/ipm_esp32/Kconfig.sysbuild b/samples/drivers/ipm/ipm_esp32/Kconfig.sysbuild index 143c6c08eb505a8..3e6504f65bbf70f 100644 --- a/samples/drivers/ipm/ipm_esp32/Kconfig.sysbuild +++ b/samples/drivers/ipm/ipm_esp32/Kconfig.sysbuild @@ -3,9 +3,3 @@ # SPDX-License-Identifier: Apache-2.0 source "share/sysbuild/Kconfig" - -config IPM_REMOTE_BOARD - string - default "esp32_devkitc_wrover/esp32/appcpu" if $(BOARD) = "esp32_devkitc_wroom" - default "esp32_devkitc_wroom/esp32/appcpu" if $(BOARD) = "esp32_devkitc_wroom" - default "esp32s3_devkitm/esp32s3/appcpu" if $(BOARD) = "esp32s3_devkitm" diff --git a/samples/drivers/ipm/ipm_esp32/boards/esp32s3_devkitm_procpu.overlay b/samples/drivers/ipm/ipm_esp32/boards/esp32s3_devkitm_procpu.overlay deleted file mode 100644 index ab1795abad77272..000000000000000 --- a/samples/drivers/ipm/ipm_esp32/boards/esp32s3_devkitm_procpu.overlay +++ /dev/null @@ -1,3 +0,0 @@ -&ipm0 { - status = "okay"; -}; diff --git a/samples/drivers/ipm/ipm_esp32/boards/yd_esp32_procpu.overlay b/samples/drivers/ipm/ipm_esp32/boards/yd_esp32_procpu.overlay deleted file mode 100644 index ab1795abad77272..000000000000000 --- a/samples/drivers/ipm/ipm_esp32/boards/yd_esp32_procpu.overlay +++ /dev/null @@ -1,3 +0,0 @@ -&ipm0 { - status = "okay"; -}; diff --git a/samples/drivers/ipm/ipm_esp32/src/procpu_shell.c b/samples/drivers/ipm/ipm_esp32/src/procpu_shell.c index e3889efa4ba5b22..c808c81b36c13cf 100644 --- a/samples/drivers/ipm/ipm_esp32/src/procpu_shell.c +++ b/samples/drivers/ipm/ipm_esp32/src/procpu_shell.c @@ -4,6 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +#if defined(CONFIG_IPM) || defined(CONIFG_MBOX) + #include #include @@ -57,3 +59,4 @@ SHELL_STATIC_SUBCMD_SET_CREATE(sub_amp, ); SHELL_CMD_REGISTER(amp, &sub_amp, "AMP debug commands.", NULL); +#endif diff --git a/samples/drivers/ipm/ipm_esp32/sysbuild.cmake b/samples/drivers/ipm/ipm_esp32/sysbuild.cmake index 1ec5cf9c3e4d335..1acb297b8b3c26f 100644 --- a/samples/drivers/ipm/ipm_esp32/sysbuild.cmake +++ b/samples/drivers/ipm/ipm_esp32/sysbuild.cmake @@ -2,11 +2,20 @@ # # Copyright 2024 Espressif +# Prepare the full board name to be used for the remote target +string(REPLACE "procpu" "appcpu" REMOTE_CPU "${BOARD_QUALIFIERS}") +string(CONFIGURE "${BOARD}${REMOTE_CPU}" IPM_REMOTE_BOARD) + +if(${REMOTE_CPU} STREQUAL ${BOARD_QUALIFIERS}) + # Make sure the remote build is using different target than host CPU + message(FATAL_ERROR "BOARD_QUALIFIERS name error. Please check the target board name string.") +endif() + # Add external project ExternalZephyrProject_Add( APPLICATION ipm_esp32_remote SOURCE_DIR ${APP_DIR}/remote - BOARD ${SB_CONFIG_IPM_REMOTE_BOARD} + BOARD ${IPM_REMOTE_BOARD} ) # Add dependencies so that the remote sample will be built first