Skip to content

Commit 7eb3f8e

Browse files
committed
cmake: sysbuild: add new HARNESS APP_TYPE, and dump APP_TYPE into domain
west flash will be able to read this APP_TYPE info and then flash the image into different boards for multiple devices testing Signed-off-by: Jingsai Lu <jingsai.lu@nxp.com>
1 parent 67f8cab commit 7eb3f8e

File tree

7 files changed

+15
-7
lines changed

7 files changed

+15
-7
lines changed

samples/bluetooth/central_ht/sample.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ tests:
99
- nrf51dk/nrf51822
1010
- nrf52dk/nrf52832
1111
tags: bluetooth
12+
sysbuild: true
1213
integration_platforms:
1314
- qemu_cortex_m3
1415
sample.bluetooth.central_ht.nxp:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SB_CONFIG_HARNESS_APPS="samples/bluetooth/peripheral_ht"

scripts/pylib/build_helpers/domains.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
build_dir:
4141
required: true
4242
type: str
43+
app_type:
44+
required: false
45+
type: str
4346
flash_order:
4447
required: false
4548
type: seq

share/sysbuild/cmake/domains.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ set(domains_yaml "${domains_yaml}\ndomains:")
1010
foreach(image ${IMAGES})
1111
set(domains_yaml "${domains_yaml}\n - name: ${image}")
1212
set(domains_yaml "${domains_yaml}\n build_dir: $<TARGET_PROPERTY:${image},_EP_BINARY_DIR>")
13+
set(domains_yaml "${domains_yaml}\n app_type: $<TARGET_PROPERTY:${image},APP_TYPE>")
1314
endforeach()
1415
set(domains_yaml "${domains_yaml}\nflash_order:")
1516
foreach(image ${IMAGES_FLASHING_ORDER})

share/sysbuild/cmake/modules/sysbuild_extensions.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ endfunction()
216216
# and debugging.
217217
#
218218
function(ExternalZephyrProject_Add)
219-
set(app_types MAIN BOOTLOADER)
219+
set(app_types MAIN BOOTLOADER HARNESS)
220220
cmake_parse_arguments(ZBUILD "" "APPLICATION;BOARD;BOARD_REVISION;SOURCE_DIR;APP_TYPE;BUILD_ONLY" "" ${ARGN})
221221

222222
if(ZBUILD_UNPARSED_ARGUMENTS)
@@ -387,6 +387,10 @@ function(ExternalZephyrProject_Add)
387387
set(image_default "${CMAKE_SOURCE_DIR}/image_configurations/ALL_image_default.cmake")
388388

389389
if(DEFINED ZBUILD_APP_TYPE)
390+
# reuse image_configurations for HARNESS APPLICATION
391+
if("${ZBUILD_APP_TYPE}" STREQUAL "HARNESS")
392+
set(ZBUILD_APP_TYPE "MAIN")
393+
endif()
390394
list(APPEND image_default "${CMAKE_SOURCE_DIR}/image_configurations/${ZBUILD_APP_TYPE}_image_default.cmake")
391395
endif()
392396

share/sysbuild/images/CMakeLists.txt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,19 @@ set(SYSBUILD_CURRENT_CMAKE_DIR)
3636
sysbuild_add_subdirectory(boards)
3737
sysbuild_add_subdirectory(soc)
3838

39-
# parse harness app list from SB_CONFIG_HARNESS_APPS and
40-
# add these app projects into sysbuild system.
39+
# parse and add harness app list from SB_CONFIG_HARNESS_APPS.
4140
if(SB_CONFIG_HARNESS_APPS)
4241
string(REPLACE "," ";" items "${SB_CONFIG_HARNESS_APPS}")
4342
message("SB_CONFIG_HARNESS_APPS: ${SB_CONFIG_HARNESS_APPS}")
44-
message("items: ${items}")
4543

4644
foreach(item IN LISTS items)
47-
message("item: ${item}")
45+
message("Adding Zephyr Project:${item} as HARNESS")
4846
string(REPLACE "/" "_" app_name ${item})
49-
message("app_name: ${app_name}")
5047
ExternalZephyrProject_Add(
5148
APPLICATION ${app_name}
5249
SOURCE_DIR ${ZEPHYR_BASE}/${item}
5350
BOARD ${BOARD}
51+
APP_TYPE HARNESS
5452
)
5553
endforeach()
5654
endif()

share/sysbuild/images/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ rsource "bootloader/Kconfig"
88
config HARNESS_APPS
99
string "List of harness apps"
1010
help
11-
List of harness apps to be built.
11+
List of harness apps to be built.

0 commit comments

Comments
 (0)