boot/bootutil: added log on swap type used
Added LOG for informing which a swap type is performed.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
diff --git a/boot/bootutil/src/swap_move.c b/boot/bootutil/src/swap_move.c
index f968fae..6f33982 100644
--- a/boot/bootutil/src/swap_move.c
+++ b/boot/bootutil/src/swap_move.c
@@ -449,6 +449,8 @@
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 @@
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;
}
diff --git a/boot/bootutil/src/swap_scratch.c b/boot/bootutil/src/swap_scratch.c
index 0979ff5..f3275c7 100644
--- a/boot/bootutil/src/swap_scratch.c
+++ b/boot/bootutil/src/swap_scratch.c
@@ -699,6 +699,8 @@
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.