Skip to content

Commit 0174415

Browse files
committed
[nrf noup] boot: bootutil: Fix issue with network core update persisting
nrf-squash! [nrf noup] boot: nrf53-specific customizations Fixes an issue whereby network core updates would persist when configured in update only mode and continually update on each reboot Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
1 parent 148712e commit 0174415

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

boot/bootutil/src/loader.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -1516,13 +1516,14 @@ boot_validated_swap_type(struct boot_loader_state *state,
15161516
swap_type = BOOT_SWAP_TYPE_FAIL;
15171517
} else {
15181518
BOOT_LOG_INF("Done updating network core");
1519-
#if defined(MCUBOOT_SWAP_USING_SCRATCH) || defined(MCUBOOT_SWAP_USING_MOVE)
15201519
/* swap_erase_trailer_sectors is undefined if upgrade only
1521-
* method is used. There is no need to erase sectors, because
1522-
* the image cannot be reverted.
1520+
* method is used
15231521
*/
1522+
#if defined(MCUBOOT_SWAP_USING_SCRATCH) || defined(MCUBOOT_SWAP_USING_MOVE)
15241523
rc = swap_erase_trailer_sectors(state,
15251524
secondary_fa);
1525+
#elif defined(MCUBOOT_OVERWRITE_ONLY)
1526+
rc = flash_area_erase(secondary_fa, 0, flash_area_get_size(secondary_fa));
15261527
#endif
15271528
swap_type = BOOT_SWAP_TYPE_NONE;
15281529
}

0 commit comments

Comments
 (0)