Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathannilsen committed Dec 15, 2024
1 parent bb6c3e4 commit 105a87d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions sysbuild/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -771,13 +771,17 @@ function(${SYSBUILD_CURRENT_MODULE_NAME}_post_cmake)
endif()
endif()

if(CONFIG_NRF_PLATFORM_HALTIUM)
if(SB_CONFIG_SOC_SERIES_NRF54HX OR SB_CONFIG_SOC_SERIES_NRF92X)
find_program(NRF_REGTOOL nrf-regtool)

foreach(image ${IMAGES})
sysbuild_get(${image}_has_uicr IMAGE ${image} VAR CONFIG_NRF_REGTOOL_GENERATE_UICR KCONFIG)
if(NOT ${image}_has_uicr)
unset(has_uicr)
sysbuild_get(has_uicr IMAGE ${image} VAR CONFIG_NRF_REGTOOL_GENERATE_UICR KCONFIG)
if(NOT has_uicr)
continue()
endif()
list(APPEND uicr_target_values "uicr-file=${BINARY_DIR}/zephyr/uicr.hex,name=${image}")
sysbuild_get(image_BINARY_DIR IMAGE ${image} VAR APPLICATION_BINARY_DIR CACHE)
list(APPEND uicr_target_values "uicr-file=${image_BINARY_DIR}/zephyr/uicr.hex,name=${image}")
endforeach()

if(uicr_target_values)
Expand All @@ -794,10 +798,11 @@ function(${SYSBUILD_CURRENT_MODULE_NAME}_post_cmake)
RESULT_VARIABLE validate_exit_code
)
# TODO: better error messages
message(STATUS "validate exit code ${validate_exit_code}")
if("${validate_exit_code}" STREQUAL "0")
message(STATUS "UICRs are OK")
else()
message(FATAL_ERROR "UICR validation with return code: ${ret}")
message(FATAL_ERROR "UICR validation failed with return code: ${validate_exit_code}")
endif()
endif()
endif()
Expand Down

0 comments on commit 105a87d

Please sign in to comment.