samples logger multidomain: Convert to sysbuild

Convert this sample application build to sysbuild.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
Alberto Escolar Piedras 2023-10-25 12:27:07 +02:00 committed by Carles Cufí
parent ca19b40733
commit ee7e6d47d1
4 changed files with 27 additions and 16 deletions

View file

@ -6,15 +6,12 @@
cmake_minimum_required(VERSION 3.20.0)
set(REMOTE_ZEPHYR_DIR ${CMAKE_CURRENT_BINARY_DIR}/log_multidomain_remote-prefix/src/log_multidomain_remote-build/zephyr)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
if("${BOARD}" STREQUAL "nrf5340dk_nrf5340_cpuapp")
set(BOARD_REMOTE "nrf5340dk_nrf5340_cpunet")
else()
if(NOT("${BOARD}" STREQUAL "nrf5340dk_nrf5340_cpuapp"))
message(FATAL_ERROR "${BOARD} is not supported for this sample")
endif()
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(log_multidomain)
target_sources(app PRIVATE src/main.c)
@ -22,14 +19,3 @@ target_sources(app PRIVATE src/main.c)
if (CONFIG_IPC_SERVICE)
target_sources(app PRIVATE src/ipc_service.c)
endif()
include(ExternalProject)
ExternalProject_Add(
log_multidomain_remote
SOURCE_DIR ${APPLICATION_SOURCE_DIR}/remote
INSTALL_COMMAND "" # This particular build system has no install command
CMAKE_CACHE_ARGS -DBOARD:STRING=${BOARD_REMOTE}
BUILD_BYPRODUCTS "${REMOTE_ZEPHYR_DIR}/${KERNEL_BIN_NAME}"
BUILD_ALWAYS True
)

View file

@ -0,0 +1,9 @@
# Copyright 2023 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: Apache-2.0
source "share/sysbuild/Kconfig"
config NET_CORE_BOARD
string
default "nrf5340dk_nrf5340_cpunet" if $(BOARD) = "nrf5340dk_nrf5340_cpuapp"

View file

@ -1,5 +1,7 @@
sample:
name: Logging in multi-domain environment
common:
sysbuild: true
tests:
sample.logging.multidomain.ipc_static_vrings:
platform_allow: nrf5340dk_nrf5340_cpuapp

View file

@ -0,0 +1,14 @@
# Copyright (c) 2023 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
if("${SB_CONFIG_NET_CORE_BOARD}" STREQUAL "")
message(FATAL_ERROR
"Target ${BOARD} not supported for this sample. "
"There is no remote board selected in Kconfig.sysbuild")
endif()
ExternalZephyrProject_Add(
APPLICATION remote
SOURCE_DIR ${APP_DIR}/remote
BOARD ${SB_CONFIG_NET_CORE_BOARD}
)