Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathannilsen committed Dec 14, 2024
1 parent 13b17af commit bb6c3e4
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions sysbuild/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,37 @@ function(${SYSBUILD_CURRENT_MODULE_NAME}_post_cmake)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${BINARY_DIR}/zephyr/.config)
endif()
endif()

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

if(uicr_target_values)
string(REPEAT "-v;" ${CONFIG_NRF_REGTOOL_VERBOSITY} verbosity)
list(TRANSFORM uicr_target_values PREPEND "--target;" OUTPUT_VARIABLE uicr_targets)
set(report_file ${BINARY_DIR}/)

execute_process(
COMMAND
${NRF_REGTOOL} ${verbosity} uicr-validate
${uicr_targets}
--output-file ${BINARY_DIR}/zephyr/uicr_report.json
WORKING_DIRECTORY ${BINARY_DIR}
RESULT_VARIABLE validate_exit_code
)
# TODO: better error messages
if("${validate_exit_code}" STREQUAL "0")
message(STATUS "UICRs are OK")
else()
message(FATAL_ERROR "UICR validation with return code: ${ret}")
endif()
endif()
endif()
endfunction(${SYSBUILD_CURRENT_MODULE_NAME}_post_cmake)

# Enable use of partition manager with sysbuild.
Expand Down

0 comments on commit bb6c3e4

Please sign in to comment.