Commit 099f4284 authored by Jamie McCrae's avatar Jamie McCrae Committed by Jamie
Browse files

boot: zephyr: Add fallback for overhead calculation when auto fails



Adds a fallback of 128 sectors for calculating the image overhead
size if auto sectors is enabled but cannot calculate the value

Signed-off-by: default avatarJamie McCrae <jamie.mccrae@nordicsemi.no>
parent 4ca606dc
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -600,7 +600,12 @@ if(SYSBUILD)
      if(CONFIG_BOOT_MAX_IMG_SECTORS_AUTO AND DEFINED slot_min_sectors AND "${slot_min_sectors}" GREATER "0")
        math(EXPR boot_status_data_size "${slot_min_sectors} * (3 * ${write_size})")
      else()
        if(CONFIG_BOOT_MAX_IMG_SECTORS)
          math(EXPR boot_status_data_size "${CONFIG_BOOT_MAX_IMG_SECTORS} * (3 * ${write_size})")
        else()
          message(WARNING "CONFIG_BOOT_MAX_IMG_SECTORS is not defined, falling back to 128 sector default. Please set CONFIG_BOOT_MAX_IMG_SECTORS to the required value")
          math(EXPR boot_status_data_size "128 * (3 * ${write_size})")
        endif()
      endif()
    else()
      set(boot_status_data_size 0)