Skip to content

Commit

Permalink
sysbuild: cmake: Fix ExternalZephyrProject_Add() revision handling
Browse files Browse the repository at this point in the history
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 <jamie.mccrae@nordicsemi.no>
  • Loading branch information
nordicjm authored and MaureenHelm committed Oct 2, 2024
1 parent a3f2ba1 commit 96c6c78
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion share/sysbuild/cmake/modules/sysbuild_extensions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,22 @@ function(ExternalZephyrProject_Add)
# unless <image>_BOARD is defined.
if(DEFINED ZBUILD_BOARD_REVISION)
# Use provided board revision
set_target_properties(${ZBUILD_APPLICATION} PROPERTIES BOARD ${ZBUILD_BOARD}@${ZBUILD_BOARD_REVISION})
if(ZBUILD_BOARD MATCHES "/")
# HWMv2 requires adding version to the board, split elements up, attach version, then
# reassemble into a complete string
string(REPLACE "/" ";" split_board_qualifiers "${ZBUILD_BOARD}")
list(GET split_board_qualifiers 0 target_board)
set(target_board ${target_board}@${ZBUILD_BOARD_REVISION})
list(REMOVE_AT split_board_qualifiers 0)
list(PREPEND split_board_qualifiers ${target_board})
string(REPLACE ";" "/" board_qualifiers "${split_board_qualifiers}")
set_target_properties(${ZBUILD_APPLICATION} PROPERTIES BOARD ${board_qualifiers})
set(split_board_qualifiers)
set(board_qualifiers)
else()
# Legacy HWMv1 support, version goes at end
set_target_properties(${ZBUILD_APPLICATION} PROPERTIES BOARD ${ZBUILD_BOARD}@${ZBUILD_BOARD_REVISION})
endif()
else()
set_target_properties(${ZBUILD_APPLICATION} PROPERTIES BOARD ${ZBUILD_BOARD})
endif()
Expand Down

0 comments on commit 96c6c78

Please sign in to comment.