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 the feedback, Nicolas!

    Something seems to be wrong with the bootloader image in your application, then. I’m afraid I can not tell you much more than this at the moment.

    When building the application in NCS v1.6.0, does the compiler throw any warnings or something that is different compared to the build in NCS you are switching from?

    Regards,

    Markus

  • Hi Markus

    I found the problem. As you said, the bootloader image had a problem. And this problem was introduced by the following CMake snippet which is part of our project CMakeLists.txt:

    if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mcuboot.conf")
    list(APPEND mcuboot_OVERLAY_CONFIG
            "${CMAKE_CURRENT_SOURCE_DIR}/mcuboot.conf")
    endif()

    This worked fine for the previous version, but for 1.6 this is breaking the MCUBoot build configuration for some reason. Unfortunately I couldn't see any hint about a problem in the build output...

    The intention of this script is to append project specific configuration to MCUBoot, namely which key to use for the signature check, which key algorithm, etc.

    I am now looking for a solution to append my MCUBoot config without modifying the external source files.
    Do you know how this can be done? Or anyone else has an idea?

    best regards

Reply
  • Hi Markus

    I found the problem. As you said, the bootloader image had a problem. And this problem was introduced by the following CMake snippet which is part of our project CMakeLists.txt:

    if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mcuboot.conf")
    list(APPEND mcuboot_OVERLAY_CONFIG
            "${CMAKE_CURRENT_SOURCE_DIR}/mcuboot.conf")
    endif()

    This worked fine for the previous version, but for 1.6 this is breaking the MCUBoot build configuration for some reason. Unfortunately I couldn't see any hint about a problem in the build output...

    The intention of this script is to append project specific configuration to MCUBoot, namely which key to use for the signature check, which key algorithm, etc.

    I am now looking for a solution to append my MCUBoot config without modifying the external source files.
    Do you know how this can be done? Or anyone else has an idea?

    best regards

Children
No Data
Related