From f5454f16358225f69ff729301c8e56d8a580f81a 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 e1cbf44f0..94ec0bfc6 100644 --- a/boot/bootutil/src/loader.c +++ b/boot/bootutil/src/loader.c @@ -2255,7 +2255,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