From ad915c66e8b257385357757f2640b96b293bbe8c Mon Sep 17 00:00:00 2001 From: Joseph Todd Date: Tue, 10 Dec 2024 13:58:08 +0000 Subject: [PATCH] boot: bootutil: loader.c: Add check if has upgrade before pushing state change Before pushing MCUBOOT_STATUS_UPGRADING, check if has_upgrade is true to ensure this is not pushed at every boot and only when needed. Signed-off-by: Joseph Todd --- boot/bootutil/src/loader.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/boot/bootutil/src/loader.c b/boot/bootutil/src/loader.c index 8efdf0f21..6606b42c9 100644 --- a/boot/bootutil/src/loader.c +++ b/boot/bootutil/src/loader.c @@ -2244,7 +2244,9 @@ context_boot_go(struct boot_loader_state *state, struct boot_rsp *rsp) #endif /* Trigger status change callback with upgrading status */ - mcuboot_status_change(MCUBOOT_STATUS_UPGRADING); + if (has_upgrade) { + mcuboot_status_change(MCUBOOT_STATUS_UPGRADING); + } /* Iterate over all the images. At this point there are no aborted swaps * and the swap types are determined for each image. By the end of the loop