Skip to content

Commit

Permalink
booutil: swap_scratch: Do not check sectors with compression
Browse files Browse the repository at this point in the history
When compression is used, it allows for the secondary slot to be
smaller than the primary slot, therefore do not ensure that the
number of sectors in each slot are the same

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
  • Loading branch information
nordicjm committed Aug 23, 2024
1 parent cf0b103 commit 394df16
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions boot/bootutil/src/swap_scratch.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,14 @@ boot_slots_compatible(struct boot_loader_state *state)
#endif
}

#ifndef MCUBOOT_DECOMPRESS_IMAGES
if ((i != num_sectors_primary) ||
(j != num_sectors_secondary) ||
(primary_slot_sz != secondary_slot_sz)) {
BOOT_LOG_WRN("Cannot upgrade: slots are not compatible");
return 0;
}
#endif

return 1;
}
Expand Down

0 comments on commit 394df16

Please sign in to comment.