This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

MCUBoot "reading sectors failed" problem with nrf-sdk v1.6.0

Hi all

We are switching to nrf-sdk v1.6.0 in our project and encountered a problem with MCUBoot.

The image builds successfully and can be flashed successfully as well. MCUBoot loads but is then unable to find a bootable image. There's a message which says:

W: Failed reading sectors; BOOT_MAX_IMG_SECTORS=128 - too small?

I tried increasing BOOT_MAX_IMG_SECTORS up to 91216. But there's still the same error message. I can't increase it more otherwise it overlaps SRAM region. I think the problem is somewhere else but I don't know where. Can someone give me a hint where to look for the problem?

I read that BOOT_MAX_IMG_SECTORS configuration is important for swapping the image in the secondary slot to the primary slot after an update.
I thought as a workaround I could configure MCUBoot to work in XIP Mode "execute in place", which does not need swapping and thus my initial problems disappears. Does anyone have a recommendation if it is a good idea to use XIP?

best regards

Parents
  • Hi Markus

    The problem occurs after i flash the board with "west flash --erase ..." (nrfjprog). So MCUBoot and application image should originate from the same nrf-sdk.

    I don't know which swap type config I am using to be honest. I let it at default configuration. After an upgrade I am required to call boot_write_img_confirmed() in order to keep it booting from the upgraded image. I want to keep that mechanism to perform some selftests before confirming.


    This is my kconfig about OTA:
    CONFIG_IMG_MANAGER=y
    CONFIG_IMG_ERASE_PROGRESSIVELY=y
    CONFIG_REBOOT=y
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_FOTA_DOWNLOAD=y
    CONFIG_DOWNLOAD_CLIENT=y
    CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
    CONFIG_DFU_TARGET=y
    CONFIG_DFU_TARGET_MCUBOOT=y

    Looking at autoconf.h after the build is finished I can't find any of these boot type definitions.

    best regards

Reply
  • Hi Markus

    The problem occurs after i flash the board with "west flash --erase ..." (nrfjprog). So MCUBoot and application image should originate from the same nrf-sdk.

    I don't know which swap type config I am using to be honest. I let it at default configuration. After an upgrade I am required to call boot_write_img_confirmed() in order to keep it booting from the upgraded image. I want to keep that mechanism to perform some selftests before confirming.


    This is my kconfig about OTA:
    CONFIG_IMG_MANAGER=y
    CONFIG_IMG_ERASE_PROGRESSIVELY=y
    CONFIG_REBOOT=y
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_FOTA_DOWNLOAD=y
    CONFIG_DOWNLOAD_CLIENT=y
    CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
    CONFIG_DFU_TARGET=y
    CONFIG_DFU_TARGET_MCUBOOT=y

    Looking at autoconf.h after the build is finished I can't find any of these boot type definitions.

    best regards

Children
No Data
Related