Commit d5460797 authored by Dominik Ermel's avatar Dominik Ermel Committed by David Brown
Browse files

bootutil: Don't default to scratch when single app is used



When MCUBOOT_SINGLE_APPLICATION_SLOT is set then the app can
only be overwritten with new image and scratch algorithm
is not used. The configuration logic would default
MCUBOOT_SWAP_USING_SCRATCH to 1 because it was lacking
check for MCUBOOT_SINGLE_APPLICATION_SLOT.

Signed-off-by: default avatarDominik Ermel <dominik.ermel@nordicsemi.no>
parent 8e8b5455
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -390,7 +390,7 @@ boot_write_enc_key(const struct flash_area *fap, uint8_t slot,

uint32_t bootutil_max_image_size(const struct flash_area *fap)
{
#if defined(MCUBOOT_SWAP_USING_SCRATCH)
#if defined(MCUBOOT_SWAP_USING_SCRATCH) || defined(MCUBOOT_SINGLE_APPLICATION_SLOT)
    return boot_status_off(fap);
#elif defined(MCUBOOT_SWAP_USING_MOVE)
    struct flash_sector sector;
+2 −1
Original line number Diff line number Diff line
@@ -64,7 +64,8 @@ struct flash_area;
#if !defined(MCUBOOT_OVERWRITE_ONLY) && \
    !defined(MCUBOOT_SWAP_USING_MOVE) && \
    !defined(MCUBOOT_DIRECT_XIP) && \
    !defined(MCUBOOT_RAM_LOAD)
    !defined(MCUBOOT_RAM_LOAD) && \
    !defined(MCUBOOT_SINGLE_APPLICATION_SLOT)
#define MCUBOOT_SWAP_USING_SCRATCH 1
#endif