File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
soc/nordic/common/uicr/gen_uicr Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,17 @@ find_package(Zephyr
1919
2020project (uicr)
2121
22+ # Function to parse a Kconfig value from a .config file
23+ function (parse_kconfig_value config_file config_name output_var)
24+ file (STRINGS ${config_file} config_lines ENCODING "UTF-8" )
25+ foreach (line ${config_lines} )
26+ if ("${line} " MATCHES "^${config_name} =\" (.*)\" $" )
27+ set (${output_var} "${CMAKE_MATCH_1} " PARENT_SCOPE)
28+ return ()
29+ endif ()
30+ endforeach ()
31+ endfunction ()
32+
2233# Function to compute partition absolute address and size from devicetree
2334function (compute_partition_address_and_size partition_nodelabel output_address_var output_size_var)
2435 dt_nodelabel(partition_path NODELABEL ${partition_nodelabel} REQUIRED)
@@ -62,7 +73,9 @@ if(CONFIG_GEN_UICR_GENERATE_PERIPHCONF)
6273 endif ()
6374
6475 if (EXISTS ${_dir} /zephyr/zephyr.dts)
65- list (APPEND periphconf_elfs ${_dir} /zephyr/zephyr.elf)
76+ # Read CONFIG_KERNEL_BIN_NAME from the sibling's .config file
77+ parse_kconfig_value(${_dir} /zephyr/.config CONFIG_KERNEL_BIN_NAME kernel_bin_name)
78+ list (APPEND periphconf_elfs ${_dir} /zephyr/${kernel_bin_name} .elf)
6679 endif ()
6780 endforeach ()
6881
You can’t perform that action at this time.
0 commit comments