Skip to content

twister: sysbuild: Bluetooth: build harness apps with sysbuild for multiple boards testing #87980

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions samples/bluetooth/central_ht/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ tests:
- nrf51dk/nrf51822
- nrf52dk/nrf52832
tags: bluetooth
sysbuild: true
integration_platforms:
- qemu_cortex_m3
sample.bluetooth.central_ht.nxp:
Expand Down
1 change: 1 addition & 0 deletions samples/bluetooth/central_ht/sysbuild.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SB_CONFIG_HARNESS_APPS="samples/bluetooth/peripheral_ht"
3 changes: 3 additions & 0 deletions scripts/pylib/build_helpers/domains.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
build_dir:
required: true
type: str
app_type:
required: false
type: str
flash_order:
required: false
type: seq
Expand Down
1 change: 1 addition & 0 deletions share/sysbuild/cmake/domains.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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: $<TARGET_PROPERTY:${image},_EP_BINARY_DIR>")
set(domains_yaml "${domains_yaml}\n app_type: $<TARGET_PROPERTY:${image},APP_TYPE>")
endforeach()
set(domains_yaml "${domains_yaml}\nflash_order:")
foreach(image ${IMAGES_FLASHING_ORDER})
Expand Down
6 changes: 5 additions & 1 deletion share/sysbuild/cmake/modules/sysbuild_extensions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()

Expand Down
17 changes: 17 additions & 0 deletions share/sysbuild/images/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
6 changes: 6 additions & 0 deletions share/sysbuild/images/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Loading