zephyr/samples/drivers/ipm/ipm_esp32/sysbuild.cmake
Marek Matej e1b4320722 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 <marek.matej@espressif.com>
2024-12-12 11:38:22 +01:00

31 lines
1.0 KiB
CMake

# SPDX-License-Identifier: Apache-2.0
#
# 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 ${IPM_REMOTE_BOARD}
)
# Add dependencies so that the remote sample will be built first
# This is required because some primary cores need information from the
# remote core's build, such as the output image's LMA
add_dependencies(ipm_esp32 ipm_esp32_remote)
sysbuild_add_dependencies(CONFIGURE ipm_esp32 ipm_esp32_remote)
if(SB_CONFIG_BOOTLOADER_MCUBOOT)
# Make sure MCUboot is flashed first
sysbuild_add_dependencies(FLASH ipm_esp32_remote mcuboot)
endif()