diff --git a/samples/bluetooth/central_ht/sample.yaml b/samples/bluetooth/central_ht/sample.yaml index 2219cac36739f..ddc22b07be7b5 100644 --- a/samples/bluetooth/central_ht/sample.yaml +++ b/samples/bluetooth/central_ht/sample.yaml @@ -9,6 +9,7 @@ tests: - nrf51dk/nrf51822 - nrf52dk/nrf52832 tags: bluetooth + sysbuild: true integration_platforms: - qemu_cortex_m3 sample.bluetooth.central_ht.nxp: diff --git a/samples/bluetooth/central_ht/sysbuild.conf b/samples/bluetooth/central_ht/sysbuild.conf new file mode 100644 index 0000000000000..4b4a4bfab2159 --- /dev/null +++ b/samples/bluetooth/central_ht/sysbuild.conf @@ -0,0 +1 @@ +SB_CONFIG_HARNESS_APPS="samples/bluetooth/peripheral_ht" diff --git a/scripts/pylib/build_helpers/domains.py b/scripts/pylib/build_helpers/domains.py index 760217cc282e9..d028054f6466a 100644 --- a/scripts/pylib/build_helpers/domains.py +++ b/scripts/pylib/build_helpers/domains.py @@ -40,6 +40,9 @@ build_dir: required: true type: str + app_type: + required: false + type: str flash_order: required: false type: seq diff --git a/share/sysbuild/cmake/domains.cmake b/share/sysbuild/cmake/domains.cmake index 1d197059bf1f3..6632d356e2294 100644 --- a/share/sysbuild/cmake/domains.cmake +++ b/share/sysbuild/cmake/domains.cmake @@ -10,6 +10,7 @@ set(domains_yaml "${domains_yaml}\ndomains:") foreach(image ${IMAGES}) set(domains_yaml "${domains_yaml}\n - name: ${image}") set(domains_yaml "${domains_yaml}\n build_dir: $") + set(domains_yaml "${domains_yaml}\n app_type: $") endforeach() set(domains_yaml "${domains_yaml}\nflash_order:") foreach(image ${IMAGES_FLASHING_ORDER}) diff --git a/share/sysbuild/cmake/modules/sysbuild_extensions.cmake b/share/sysbuild/cmake/modules/sysbuild_extensions.cmake index a0ca87c4253cd..1b0e84562d106 100644 --- a/share/sysbuild/cmake/modules/sysbuild_extensions.cmake +++ b/share/sysbuild/cmake/modules/sysbuild_extensions.cmake @@ -216,7 +216,7 @@ endfunction() # and debugging. # function(ExternalZephyrProject_Add) - set(app_types MAIN BOOTLOADER) + set(app_types MAIN BOOTLOADER HARNESS) cmake_parse_arguments(ZBUILD "" "APPLICATION;BOARD;BOARD_REVISION;SOURCE_DIR;APP_TYPE;BUILD_ONLY" "" ${ARGN}) if(ZBUILD_UNPARSED_ARGUMENTS) @@ -387,6 +387,10 @@ function(ExternalZephyrProject_Add) set(image_default "${CMAKE_SOURCE_DIR}/image_configurations/ALL_image_default.cmake") if(DEFINED ZBUILD_APP_TYPE) + # reuse image_configurations for HARNESS APPLICATION + if("${ZBUILD_APP_TYPE}" STREQUAL "HARNESS") + set(ZBUILD_APP_TYPE "MAIN") + endif() list(APPEND image_default "${CMAKE_SOURCE_DIR}/image_configurations/${ZBUILD_APP_TYPE}_image_default.cmake") endif() diff --git a/share/sysbuild/images/CMakeLists.txt b/share/sysbuild/images/CMakeLists.txt index 1d9e381fa5c45..1ee48e76bf0ff 100644 --- a/share/sysbuild/images/CMakeLists.txt +++ b/share/sysbuild/images/CMakeLists.txt @@ -35,3 +35,20 @@ set(SYSBUILD_CURRENT_CMAKE_DIR) # This allows for board and SoC specific images to be included. sysbuild_add_subdirectory(boards) sysbuild_add_subdirectory(soc) + +# parse and add harness app list from SB_CONFIG_HARNESS_APPS. +if(SB_CONFIG_HARNESS_APPS) + string(REPLACE "," ";" items "${SB_CONFIG_HARNESS_APPS}") + message("SB_CONFIG_HARNESS_APPS: ${SB_CONFIG_HARNESS_APPS}") + + foreach(item IN LISTS items) + message("Adding Zephyr Project:${item} as HARNESS") + string(REPLACE "/" "_" app_name ${item}) + ExternalZephyrProject_Add( + APPLICATION ${app_name} + SOURCE_DIR ${ZEPHYR_BASE}/${item} + BOARD ${BOARD} + APP_TYPE HARNESS + ) + endforeach() +endif() diff --git a/share/sysbuild/images/Kconfig b/share/sysbuild/images/Kconfig index 616b0a7c23d4b..872ac09e0df76 100644 --- a/share/sysbuild/images/Kconfig +++ b/share/sysbuild/images/Kconfig @@ -3,3 +3,9 @@ # SPDX-License-Identifier: Apache-2.0 rsource "bootloader/Kconfig" + + +config HARNESS_APPS + string "List of harness apps" + help + List of harness apps to be built.