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 Reply Children
  • 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.  

  • Hi,

     

    You need some way to reset the device.

     

    The only good option if you do not have a nRESET button/signal, is to do a power cycle while holding in the button to enter bootloader serial recovery mode.

     

    Kind regards,

    Håkon

  • Hi Hakon,

    There is no button available on our device. From the application can we reset the device? Is there any sample code to do it?

    In our custom board, we power the device by giving 5v to VDDH pin. Is it sufficient to run serial recovery mode?

    Any suggestion on this will help us a lot

    Thank you

  • Hi, 

    I see this topic is new and active, I thought I'd jump in Slight smile

    I have this exact same issue, when I try to integrate the MCUboot to my blinky app on the PCA10040 board. My setup is almost exact as in the example you provided, with the only difference of removing

    CONFIG_MCUBOOT_SERIAL
    and 
    CONFIG_BOOT_SERIAL_CDC_ACM
    flags, since I'm running this on PCA10040. 
    When I compile and flash the bootloader separately in bootloader/mcuboot/boot/zephyr/, it works fine, but when I integrate it with the blinky app, I get the same error, although i see in bootloader/mcuboot/boot/zephyr/build/zephyr/.config that the BOOT_MAX_IMG_SECTORS config is 128 as well. 
    NB! Also tried changing this value to 256 and 64 without any results.
    With regards,

    UPDATE:
    I have come to realize that it has something to do with the overlay file and the build system. I use
    west build -b nrf52dk_nrf52832 -- -Dmcuboot_OVERLAY_CONFIG=<app_samples>/basic/blinky/usb_cdc_acm_log_recovery.conf
    to build my application.
    Even if I have a completely empty usb_cdc_acm_recovery.conf file, the issue occurs. And vice versa, when I just paste these configs directly into bootloaders prj.conf, it works fine.
  • Hi,

     

    Gireesha said:
    There is no button available on our device. From the application can we reset the device? Is there any sample code to do it?

    Unfortunately, we do not have a way to trigger/enter serial recovery without a button at this time.

     

    Kind regards,

    Håkon

Related