Skip to content

Commit

Permalink
bootutil: Fix for flash_area_id_to_image
Browse files Browse the repository at this point in the history
The function was incorrectly identifying partition of secondary slot
of image 0 as belonging to image 1, at the same time failing to
identify partition of primary slot of image 1.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
  • Loading branch information
de-nordic authored and nvlsianpu committed Aug 7, 2023
1 parent f17b005 commit 0540d0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion boot/bootutil/src/bootutil_public.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ static int flash_area_id_to_image(int id)
#if BOOT_IMAGE_NUMBER > 2
#error "BOOT_IMAGE_NUMBER > 2 requires change to flash_area_id_to_image"
#elif BOOT_IMAGE_NUMBER > 1
if (FLASH_AREA_IMAGE_SECONDARY(0) == id || (FLASH_AREA_IMAGE_SECONDARY(1) == id)) {
if (FLASH_AREA_IMAGE_PRIMARY(1) == id || (FLASH_AREA_IMAGE_SECONDARY(1) == id)) {
return 1;
}
#else
Expand Down

0 comments on commit 0540d0f

Please sign in to comment.