Skip to content

Commit 8e373cc

Browse files
de-nordicjfischer-no
authored andcommitted
[nrf noup] loader: Do not check reset vector for XIP image
The XIP image, 2, does not have reset vector. Signed-off-by: Dominik Ermel <[email protected]> (cherry picked from commit 30181d8)
1 parent 7b87633 commit 8e373cc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

boot/bootutil/src/loader.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,16 @@ boot_validate_slot(struct boot_loader_state *state, int slot,
823823
* overwriting an application written to the incorrect slot.
824824
* This feature is only supported by ARM platforms.
825825
*/
826+
#if MCUBOOT_IMAGE_NUMBER >= 3
827+
/* Currently the MCUboot can be configured for up to 3 image, where image number 2 is
828+
* designated for XIP, where it is the second part of image stored in slots of image
829+
* 0. This part of image is not bootable, as the XIP setup is done by the app in
830+
* image 0 slot, and it does not carry the reset vector.
831+
*/
832+
if (area_id == FLASH_AREA_IMAGE_SECONDARY(2)) {
833+
goto out;
834+
}
835+
#endif
826836
if (area_id == FLASH_AREA_IMAGE_SECONDARY(BOOT_CURR_IMG(state))) {
827837
const struct flash_area *pri_fa = BOOT_IMG_AREA(state, BOOT_PRIMARY_SLOT);
828838
struct image_header *secondary_hdr = boot_img_hdr(state, slot);

0 commit comments

Comments
 (0)