Skip to content

Commit 8667800

Browse files
benedekkuppernordicjm
authored andcommitted
zephyr: use REQUIRED in dt_nodelabel calls to fail early and with meaningful message
When the devicetree was missing a label, I'd get this kind of errors, which were not very helpful: CMake Error at workspace/zephyr/cmake/modules/extensions.cmake:3979 (message): dt_prop(erase_size_slot1 ...) missing required argument: PATH Call Stack (most recent call first): CMakeLists.txt:496 (dt_prop) The new error message looks like this: CMake Error at workspace/zephyr/cmake/modules/extensions.cmake:3748 (message): required nodelabel not found: slot1_partition Signed-off-by: Benedek Kupper <[email protected]>
1 parent 351eb15 commit 8667800

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

boot/zephyr/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ function(dt_get_parent node)
478478
set(${node} "${${node}}" PARENT_SCOPE)
479479
endfunction()
480480

481-
dt_nodelabel(slot0_flash NODELABEL "slot0_partition")
481+
dt_nodelabel(slot0_flash NODELABEL "slot0_partition" REQUIRED)
482482
dt_prop(slot0_size PATH "${slot0_flash}" PROPERTY "reg" INDEX 1)
483483
dt_get_parent(slot0_flash)
484484
dt_get_parent(slot0_flash)
@@ -496,7 +496,7 @@ if(CONFIG_BOOT_SWAP_USING_MOVE OR CONFIG_BOOT_SWAP_USING_OFFSET)
496496
endif()
497497

498498
if(NOT CONFIG_SINGLE_APPLICATION_SLOT AND NOT CONFIG_SINGLE_APPLICATION_SLOT_RAM_LOAD)
499-
dt_nodelabel(slot1_flash NODELABEL "slot1_partition")
499+
dt_nodelabel(slot1_flash NODELABEL "slot1_partition" REQUIRED)
500500
dt_prop(slot1_size PATH "${slot1_flash}" PROPERTY "reg" INDEX 1)
501501
dt_get_parent(slot1_flash)
502502
dt_get_parent(slot1_flash)
@@ -556,12 +556,12 @@ endif()
556556
if(SYSBUILD)
557557
if(CONFIG_SINGLE_APPLICATION_SLOT OR CONFIG_BOOT_FIRMWARE_LOADER OR CONFIG_BOOT_SWAP_USING_SCRATCH OR CONFIG_BOOT_SWAP_USING_MOVE OR CONFIG_BOOT_SWAP_USING_OFFSET OR CONFIG_BOOT_UPGRADE_ONLY OR CONFIG_BOOT_DIRECT_XIP OR CONFIG_BOOT_RAM_LOAD)
558558
# TODO: RAM LOAD support
559-
dt_nodelabel(slot0_flash NODELABEL "slot0_partition")
559+
dt_nodelabel(slot0_flash NODELABEL "slot0_partition" REQUIRED)
560560
dt_get_parent(slot0_flash)
561561
dt_get_parent(slot0_flash)
562562

563563
if(NOT CONFIG_SINGLE_APPLICATION_SLOT)
564-
dt_nodelabel(slot1_flash NODELABEL "slot1_partition")
564+
dt_nodelabel(slot1_flash NODELABEL "slot1_partition" REQUIRED)
565565
dt_get_parent(slot1_flash)
566566
dt_get_parent(slot1_flash)
567567

0 commit comments

Comments
 (0)