Commit f9dbf683 authored by Andrzej Puzdrowski's avatar Andrzej Puzdrowski Committed by David Brown
Browse files

boot/bootutil: added log on swap type used



Added LOG for informing which a swap type is performed.

Signed-off-by: default avatarAndrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
parent 39eb63df
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -449,6 +449,8 @@ swap_run(struct boot_loader_state *state, struct boot_status *bs,
    const struct flash_area *fap_sec;
    int rc;

    BOOT_LOG_INF("Starting swap using move algorithm.");

    sz = 0;
    g_last_idx = 0;

@@ -480,6 +482,9 @@ swap_run(struct boot_loader_state *state, struct boot_status *bs,

        if (g_last_idx >= first_trailer_idx) {
            BOOT_LOG_WRN("Not enough free space to run swap upgrade");
            BOOT_LOG_WRN("required %d bytes but only %d are available",
                         (g_last_idx + 1) * sector_sz ,
                         first_trailer_idx * sector_sz);
            bs->swap_type = BOOT_SWAP_TYPE_NONE;
            return;
        }
+2 −0
Original line number Diff line number Diff line
@@ -699,6 +699,8 @@ swap_run(struct boot_loader_state *state, struct boot_status *bs,
    last_sector_idx = 0;
    last_idx_secondary_slot = 0;

    BOOT_LOG_INF("Starting swap using scratch algorithm.");

    /*
     * Knowing the size of the largest image between both slots, here we
     * find what is the last sector in the primary slot that needs swapping.