Skip to content

Commit 180f1f8

Browse files
SebastianBoecfriedt
authored andcommitted
soc: noric: nrf54h20: Fix custom CONFIG_KERNEL_BIN_NAME bug
Fix bug where users were unable to name their binary Bøe when building for nrf54h20. Signed-off-by: Sebastian Bøe <[email protected]>
1 parent 1d6a772 commit 180f1f8

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ find_package(Zephyr
1919

2020
project(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
2334
function(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

0 commit comments

Comments
 (0)