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

Parents
  • 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,

    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

  • Hi Hakon,

    Development Environment used: ncs sdk v1.7.1 (Zeyphr RTOS

    MCU: nRF52840

    It is a custom board and doesn't have reset button. We need to put the custom board into the casing. Currently we are flashing the code using SWD. But now we want to update / flash the firmware using USB. Please let us know how can we achieve this?

    What we are trying to achieve is to do DFU / Flashing from USB using MCUBootloader. We followed the following link https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/software/posts/device-firmware-update-dfu-with-mcuboot-bootloader to achieve it. But we are facing with the below mentioned error.

    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

  • Hi,

     

    Here's a quickly edited "blinky" sample, with the changes described in the link you posted:

     

    This boots as expected on my end. Do you still see issues with this one?

    Please note that the mcuboot configuration is located in the child_image directory.

     

    Kind regards,

    Håkon

  • Hi Hakon,

    From the sample example provided by you, We were able to successfully put the device into bootloader mode by pressing the button 1 and reset button and we are able to perform DFU.

    But, now in our custom device (nrf52840) doesn't have any button (reset / button). How do we implement this DFU method for our custom board. 

    Please help us, matter is very urgent.  

Reply Children
Related