Device Firmware Update (DFU) with MCUBoot bootloader showing Failed reading sectors; BOOT_MAX_IMG_SECTORS=128 - too small?

Hi All,

I am trying to do  Device Firmware Update (DFU) with MCUBoot bootloader for nrf52840 DK and I am following this link https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/software/posts/device-firmware-update-dfu-with-mcuboot-bootloader, Till 17th step its working as expected but when i run the west flash command I am getting the following error in the board 

*** Booting Zephyr OS build v2.6.99-ncs1-1 ***
I: Starting bootloader
W: Failed reading sectors; BOOT_MAX_IMG_SECTORS=128 - too small?
W: Cannot upgrade: not a compatible amount of sectors
E: Unable to find bootable image

~Thanks in advance

  • Hi,

     

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

    This configuration should match the largest image that you support. 128*4k = 512k. If your images are larger, you should adjust this value. It is typically 256 for a 1MB flash device, such as nRF52840.

     

    Kind regards,

    Håkon

  • Hello Hakon,

    I have updated CONFIG_BOOT_MAX_IMG_SECTORS= 256 in usb_cdc_acm_log_recovery.conf file, after flashing i am getting the following error.

    *** Booting Zephyr OS build v2.6.99-ncs1-1 ***
    I: Starting bootloader
    W: Failed reading sectors; BOOT_MAX_IMG_SECTORS=256 - too small?
    W: Cannot upgrade: not a compatible amount of sectors
    E: Unable to find bootable image

    where i can modify BOOT_MAX_IMG_SECTORS ?

    ~Thanks

  • Hi,

     

    What exactly are you doing to recreate this scenario? ie. which project are you using and what specifically did you change in this process?

    Is this occurring when you issue an updated "app_update.bin" to mcuboot, or when you initially flash your project?

     

    Kind regards,

    Håkon 

  • Hi,

    after west build i am getting merged.hex file

    [199/206] Linking C executable zephyr/zephyr_prebuilt.elf

    [206/206] Linking C executable zephyr/zephyr.elf
    Memory region Used Size Region Size %age Used
    FLASH: 62984 B 256 KB 24.03%
    SRAM: 33440 B 256 KB 12.76%
    IDT_LIST: 0 GB 2 KB 0.00%
    [151/166] Linking C executable zephyr/zephyr_prebuilt.elf

    [158/166] Linking C executable zephyr/zephyr.elf
    Memory region Used Size Region Size %age Used
    FLASH: 19816 B 392704 B 5.05%
    SRAM: 7424 B 256 KB 2.83%
    IDT_LIST: 0 GB 2 KB 0.00%
    [166/166] Generating zephyr/merged.hex

    after this i am flashing using west flash command and it successfully flashed the hex file.

    after running the west flash command only i am getting the error

    *** Booting Zephyr OS build v2.6.99-ncs1-1 ***
    I: Starting bootloader
    W: Failed reading sectors; BOOT_MAX_IMG_SECTORS=128 - too small?
    W: Cannot upgrade: not a compatible amount of sectors
    E: Unable to find bootable image

    ~Thanks

  • Hi,

     

    This means that you are seeing this after directly flashing your device. Which sample are you using, and have you done any specific changes to it? This will help me reproduce the error to debug the scenario at my end.

     

    Kind regards,

    Håkon

Related