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
  • Thanks a lot for your feedback, Nicolas. It is really appreciated.

    n.marty said:
    it is dropping the partition manager configuration "partition_manager_enabled.conf" for some reason which in my eyes is a bug.

     I’m not quite sure if this is a bug, really. 

    n.marty said:
    What is the best practice to build MCUBoot with own configuration flags?

     Could you please follow this guideline and check if that would work for you? The child_image directory configuration mechanism is what we normally recommend to do.

    Regards,

    Markus

  • Hi Markus

    The MCUBoot child_image is added automatically when I set CONFIG_BOOTLOADER_MCUBOOT=y in my prj.conf. If I manually add a child_image within my project's CMakeLists.txt I get a "duplicated child image error".

    The solution for me was to use add_overlay_config() instead of add_child_image() in my project's CMakeLists.txt.
    add_overlay_config() is part of sdk-nrf/cmake/extensions.cmake

    In the beginning, I manually modified the variable mcuboot_OVERLAY_CONFIG which created a mess (and the problem I initially observed). When using add_overlay_config() the variable gets updated correctly. Unfortunately, the guideline does not mention the usage of add_overlay_config() in order to inject kconfig overlay to a child image.

    best regards

Reply
  • Hi Markus

    The MCUBoot child_image is added automatically when I set CONFIG_BOOTLOADER_MCUBOOT=y in my prj.conf. If I manually add a child_image within my project's CMakeLists.txt I get a "duplicated child image error".

    The solution for me was to use add_overlay_config() instead of add_child_image() in my project's CMakeLists.txt.
    add_overlay_config() is part of sdk-nrf/cmake/extensions.cmake

    In the beginning, I manually modified the variable mcuboot_OVERLAY_CONFIG which created a mess (and the problem I initially observed). When using add_overlay_config() the variable gets updated correctly. Unfortunately, the guideline does not mention the usage of add_overlay_config() in order to inject kconfig overlay to a child image.

    best regards

Children
No Data
Related