diff --git a/sysbuild/CMakeLists.txt b/sysbuild/CMakeLists.txt index 7460683d717c..339aafb60e66 100644 --- a/sysbuild/CMakeLists.txt +++ b/sysbuild/CMakeLists.txt @@ -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) @@ -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()