diff --git a/boot/bootutil/src/swap_scratch.c b/boot/bootutil/src/swap_scratch.c index 360dbe88c..6581b55a6 100644 --- a/boot/bootutil/src/swap_scratch.c +++ b/boot/bootutil/src/swap_scratch.c @@ -926,7 +926,7 @@ boot_swap_sectors(int idx, uint32_t sz, struct boot_loader_state *state, * happens then the scratch which is partially erased would be wrote back to the * primary slot, causing a corrupt unbootable image */ - rc = boot_erase_region(fap_scratch, 0, flash_area_get_size(fap_scratch), true); + rc = boot_scramble_region(fap_scratch, 0, flash_area_get_size(fap_scratch), true); assert(rc == 0); } }