File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -492,15 +492,24 @@ if(SYSBUILD)
492492 endif ()
493493
494494 math (EXPR required_size "${key_size} + ${boot_magic_size} + ${boot_swap_data_size} + ${boot_status_data_size} + ${boot_tlv_estimate} " )
495-
496495 align_up(${required_size} ${erase_size} required_size)
497496
497+ if (CONFIG_SINGLE_APPLICATION_SLOT OR CONFIG_BOOT_FIRMWARE_LOADER)
498+ set (required_upgrade_size "0" )
499+ else ()
500+ math (EXPR required_upgrade_size "${boot_magic_size} + ${boot_swap_data_size} + ${boot_status_data_size} " )
501+ align_up(${required_upgrade_size} ${erase_size} required_upgrade_size)
502+ endif ()
503+
498504 if (CONFIG_BOOT_SWAP_USING_MOVE)
499505 math (EXPR required_size "${required_size} + ${erase_size} " )
506+ math (EXPR required_upgrade_size "${required_upgrade_size} + ${erase_size} " )
500507 endif ()
501508 else ()
502509 set (required_size 0)
510+ set (required_upgrade_size 0)
503511 endif ()
504512
505513 set (mcuboot_image_footer_size ${required_size} CACHE INTERNAL "Estimated MCUboot image trailer size" FORCE)
514+ set (mcuboot_image_upgrade_footer_size ${required_upgrade_size} CACHE INTERNAL "Estimated MCUboot update image trailer size" FORCE)
506515endif ()
Original file line number Diff line number Diff line change @@ -31,9 +31,12 @@ function(${SYSBUILD_CURRENT_MODULE_NAME}_post_image_cmake)
3131
3232 if ("${app_type} " STREQUAL "MAIN" )
3333 sysbuild_get(mcuboot_image_footer_size IMAGE mcuboot CACHE )
34+ sysbuild_get(mcuboot_image_upgrade_footer_size IMAGE mcuboot CACHE )
3435 math (EXPR mcuboot_image_footer_size "${mcuboot_image_footer_size} " OUTPUT_FORMAT HEXADECIMAL)
36+ math (EXPR mcuboot_image_upgrade_footer_size "${mcuboot_image_upgrade_footer_size} " OUTPUT_FORMAT HEXADECIMAL)
3537
3638 set_property (TARGET ${image} APPEND_STRING PROPERTY CONFIG "CONFIG_ROM_END_OFFSET=${mcuboot_image_footer_size} \n " )
39+ set_property (TARGET ${image} APPEND_STRING PROPERTY CONFIG "CONFIG_MCUBOOT_UPDATE_FOOTER_SIZE=${mcuboot_image_upgrade_footer_size} \n " )
3740 return ()
3841 endif ()
3942 endforeach ()
You can’t perform that action at this time.
0 commit comments