Skip to content

Commit

Permalink
boot: bootutil: loader.c: Add check if has upgrade before pushing sta…
Browse files Browse the repository at this point in the history
…te 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 <joseph.todd@lascar.co.uk>
  • Loading branch information
juser19201 authored and nordicjm committed Dec 16, 2024
1 parent 5b1c77d commit f5454f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion boot/bootutil/src/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f5454f1

Please sign in to comment.