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
19
19
20
20
project (uicr)
21
21
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
+
22
33
# Function to compute partition absolute address and size from devicetree
23
34
function (compute_partition_address_and_size partition_nodelabel output_address_var output_size_var)
24
35
dt_nodelabel(partition_path NODELABEL ${partition_nodelabel} REQUIRED)
@@ -62,7 +73,9 @@ if(CONFIG_GEN_UICR_GENERATE_PERIPHCONF)
62
73
endif ()
63
74
64
75
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)
66
79
endif ()
67
80
endforeach ()
68
81
You can’t perform that action at this time.
0 commit comments