Skip to content

Commit 9887176

Browse files
committed
[nrf noup] zephyr: Fix compilation error with address verification
Fix compilation error with missing definitions of SECOND_STAGE_MCUBOOT_INACTIVE_OFFSET/SIZE when MCUBOOT_VERIFY_IMG_ADDRESS is enabled. Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
1 parent da9857d commit 9887176

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

boot/bootutil/src/loader.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,11 +822,14 @@ boot_validate_slot(struct boot_loader_state *state, int slot,
822822
check_addresses = true;
823823
} else
824824
#endif
825+
#ifdef MCUBOOT_IS_SECOND_STAGE
825826
if (IMAGE_IS_SECOND_STAGE_MCUBOOT(state)) {
826827
min_addr = SECOND_STAGE_INACTIVE_MCUBOOT_OFFSET;
827828
max_addr = (SECOND_STAGE_INACTIVE_MCUBOOT_OFFSET + SECOND_STAGE_INACTIVE_MCUBOOT_SIZE);
828829
check_addresses = true;
829-
} else if (BOOT_CURR_IMG(state) == CONFIG_MCUBOOT_APPLICATION_IMAGE_NUMBER) {
830+
} else
831+
#endif
832+
if (BOOT_CURR_IMG(state) == CONFIG_MCUBOOT_APPLICATION_IMAGE_NUMBER) {
830833
min_addr = flash_area_get_off(BOOT_IMG_AREA(state, BOOT_SLOT_PRIMARY));
831834
max_addr = flash_area_get_size(BOOT_IMG_AREA(state, BOOT_SLOT_PRIMARY)) + min_addr;
832835

0 commit comments

Comments
 (0)