Skip to content

Commit 2086582

Browse files
nordicjmgithub-actions[bot]
authored andcommitted
sysbuild: cmake: Fix ExternalZephyrProject_Add() revision handling
Fixes an issue with HWMv2 boards whereby the specified board revision was not applied at the correct place, which would cause the target image to fail configuration Fixes #79208 Signed-off-by: Jamie McCrae <[email protected]> (cherry picked from commit 96c6c78)
1 parent b26773f commit 2086582

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

share/sysbuild/cmake/modules/sysbuild_extensions.cmake

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,22 @@ function(ExternalZephyrProject_Add)
386386
# unless <image>_BOARD is defined.
387387
if(DEFINED ZBUILD_BOARD_REVISION)
388388
# Use provided board revision
389-
set_target_properties(${ZBUILD_APPLICATION} PROPERTIES BOARD ${ZBUILD_BOARD}@${ZBUILD_BOARD_REVISION})
389+
if(ZBUILD_BOARD MATCHES "/")
390+
# HWMv2 requires adding version to the board, split elements up, attach version, then
391+
# reassemble into a complete string
392+
string(REPLACE "/" ";" split_board_qualifiers "${ZBUILD_BOARD}")
393+
list(GET split_board_qualifiers 0 target_board)
394+
set(target_board ${target_board}@${ZBUILD_BOARD_REVISION})
395+
list(REMOVE_AT split_board_qualifiers 0)
396+
list(PREPEND split_board_qualifiers ${target_board})
397+
string(REPLACE ";" "/" board_qualifiers "${split_board_qualifiers}")
398+
set_target_properties(${ZBUILD_APPLICATION} PROPERTIES BOARD ${board_qualifiers})
399+
set(split_board_qualifiers)
400+
set(board_qualifiers)
401+
else()
402+
# Legacy HWMv1 support, version goes at end
403+
set_target_properties(${ZBUILD_APPLICATION} PROPERTIES BOARD ${ZBUILD_BOARD}@${ZBUILD_BOARD_REVISION})
404+
endif()
390405
else()
391406
set_target_properties(${ZBUILD_APPLICATION} PROPERTIES BOARD ${ZBUILD_BOARD})
392407
endif()

0 commit comments

Comments
 (0)