Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boot: zephyr: cmake: Fix issue with missing dts entries #1877

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 25 additions & 5 deletions boot/zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -393,15 +393,27 @@ if(SYSBUILD)
dt_prop(erase_size_slot1 PATH "${slot1_flash}" PROPERTY "erase-block-size")
dt_prop(write_size_slot1 PATH "${slot1_flash}" PROPERTY "write-block-size")

if(${erase_size_slot0} GREATER ${erase_size_slot1})
if(DEFINED erase_size_slot0 AND DEFINED erase_size_slot1)
if(${erase_size_slot0} GREATER ${erase_size_slot1})
set(erase_size ${erase_size_slot0})
else()
set(erase_size ${erase_size_slot1})
endif()
elseif(DEFINED erase_size_slot0)
set(erase_size ${erase_size_slot0})
else()
elseif(DEFINED erase_size_slot1)
set(erase_size ${erase_size_slot1})
endif()

if(${write_size_slot0} GREATER ${write_size_slot1})
if(DEFINED write_size_slot0 AND DEFINED write_size_slot1)
if(${write_size_slot0} GREATER ${write_size_slot1})
set(write_size ${write_size_slot0})
else()
set(write_size ${write_size_slot1})
endif()
elseif(DEFINED write_size_slot0)
set(write_size ${write_size_slot0})
else()
elseif(DEFINED write_size_slot1)
set(write_size ${write_size_slot1})
endif()
else()
Expand All @@ -413,7 +425,15 @@ if(SYSBUILD)
dt_prop(write_size PATH "${slot0_flash}" PROPERTY "write-block-size")
endif()

if(write_size LESS 8)
if(NOT DEFINED erase_size)
message(WARNING "Unable to determine erase size of slot0 or slot1 partition, setting to 1 (this is probably wrong)")
set(erase_size 1)
endif()

if(NOT DEFINED write_size)
message(WARNING "Unable to determine write size of slot0 or slot1 partition, setting to 8 (this is probably wrong)")
set(write_size 8)
elseif(write_size LESS 8)
set(write_size 8)
endif()

Expand Down
Loading