Skip to content

Commit 4325b1d

Browse files
committed
[nrf fromtree] soc: nordic: nrf71: uicr: Fix hex_file override from main image
Move set_target_properties for runners_yaml_props_target below board.cmake include so that UICR image always flashes its own output regardless of the main image configuration. When the main image targets cpuapp/ns (TF-M), import_kconfig() pulls CONFIG_TFM_FLASH_MERGED_BINARY into the UICR image's CMake scope. This causes board.cmake to override hex_file with tfm_merged.hex, which does not exist in the UICR utility image, resulting in a flash failure. Signed-off-by: Dhanoo Surasarang <dhanoo.surasarang@nordicsemi.no> (cherry picked from commit 16fe56e)
1 parent bcda293 commit 4325b1d

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

soc/nordic/nrf71/uicr/gen_uicr/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ add_custom_target(gen_uicr ALL DEPENDS ${uicr_hex})
4141

4242
# Create the runners_yaml_props_target that flash system expects
4343
add_custom_target(runners_yaml_props_target)
44-
set_target_properties(runners_yaml_props_target PROPERTIES
45-
hex_file "zephyr.hex"
46-
)
4744

4845
# Copy over Kconfig and dts files from the main image
4946
get_filename_component(default_image_binary_dir ${DEFAULT_IMAGE_EDT_PICKLE} DIRECTORY)
@@ -60,6 +57,11 @@ foreach(dir ${BOARD_DIRECTORIES})
6057
include(${dir}/board.cmake OPTIONAL)
6158
endforeach()
6259

60+
# Override hex_file after board.cmake to ensure it always flash its own output
61+
set_target_properties(runners_yaml_props_target PROPERTIES
62+
hex_file "zephyr.hex"
63+
)
64+
6365
# Include flash support to automatically generate runners.yaml
6466
include(${ZEPHYR_BASE}/cmake/flash/CMakeLists.txt)
6567

0 commit comments

Comments
 (0)