Skip to content

Commit 3f87d7c

Browse files
maass-hamburgseyoungjeong
authored andcommitted
mcuboot: cmake: only set write_block_size when needed
only set write_block_size when needed and don't output a warning, when it's not needed Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
1 parent e40d8d9 commit 3f87d7c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

cmake/mcuboot.cmake

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,6 @@ function(zephyr_mcuboot_tasks)
8686
dt_chosen(flash_node PROPERTY "zephyr,flash")
8787
dt_nodelabel(slot0_flash NODELABEL "slot0_partition" REQUIRED)
8888
dt_prop(slot_size PATH "${slot0_flash}" PROPERTY "reg" INDEX 1 REQUIRED)
89-
dt_prop(write_block_size PATH "${flash_node}" PROPERTY "write-block-size")
90-
91-
if(NOT write_block_size)
92-
set(write_block_size 4)
93-
message(WARNING "slot0_partition write block size devicetree parameter is missing, assuming write block size is 4")
94-
endif()
9589

9690
# If single slot mode, or if in firmware updater mode and this is the firmware updater image,
9791
# use slot 0 information
@@ -149,6 +143,13 @@ function(zephyr_mcuboot_tasks)
149143
endif()
150144
set(imgtool_args --align 1 --load-addr ${load_address} ${imgtool_args})
151145
else()
146+
dt_prop(write_block_size PATH "${flash_node}" PROPERTY "write-block-size")
147+
148+
if(NOT write_block_size)
149+
set(write_block_size 4)
150+
message(WARNING "slot0_partition write block size devicetree parameter is missing, assuming write block size is 4")
151+
endif()
152+
152153
set(imgtool_args --align ${write_block_size} ${imgtool_args})
153154
endif()
154155

0 commit comments

Comments
 (0)