BL-653(nrf52833) failed to boot the FW from secondary slot of mcuboot which is located in external flash.

I have a BL653 module and with a lot of efforts somehow I was able to successfully create a secondary slot for mcuboot in external flash connected using SPI. Every time I try to DFU over BLE the latest FW image gets loaded in external flash which is secondary slot - slot 1. But I am unable to load the latest FW image in slot-0 or to boot the latest FW from slot-1 itself. I am using nRFDeviceManager app for my experimentation and try to upload the dfu-application.zip from build folder. When  I click TEST the RTT shows  <err> mcumgr_img_grp: Faled boot_set_next with code 3, for slot 1, with active slot 0 and confirm 0. Also the app reports error Invalid image header magic(23)

Here are the snips from app

Here are the settings from mcuboot.conf file

Here is zip of my build folder

4532.build.zip

Could anyone guide me on how to boot the image from secondary slot or copy it in primary slot

Parents Reply Children
  • Here are the logs I get when I try to boot the latest image from external flash, I have highlighted the logs from mcuboot. I am really not sure are these the correct one that you are referring to. If there is any macro to enable boot logs please let me know.

    Can you try a couple of those and see if that works for you? Specifically the one with external flash and UART (does external flash DFU work?) and the one with BLE (does BLE DFU work?).

    The BLE DFU worked well with internal flash. And I think I have referred couple of examples from the link you have provided. The problem is most of the examples are configured for nrf52840 or nrf9160 while I am working with nrf52833. So I just copied the relevant settings from those and copied that in my project. Still I will take a look at the link.

    Talkin about external flash yes the DFU works and the latest image gets loaded in slot-1 which is located in external flash. The only problem is am not able to copy the latest FW in slot-0 which is in internal flash or boot the FW from slot-1 itself.

  • Aniket95 said:
    If there is any macro to enable boot logs please let me know.

    Indeed there is. You can enable logging in the MCUboot child image.

    See here for an example of how. Remember to put it in child_image/mcuboot.conf, as is done in the sample.

    Aniket95 said:
    Talkin about external flash yes the DFU works and the latest image gets loaded in slot-1 which is located in external flash. The only problem is am not able to copy the latest FW in slot-0 which is in internal flash or boot the FW from slot-1 itself.

    The way this works is a 2 step procedure:

    1. New image is uploaded to slot-1 (also known as mcuboot_secondary)

    2. Tag mcuboot_secondary as "test" or "confirm". On next boot, mcuboot will recognice this and swap slot-0 and slot-1.

    Seems like 1 works. So we need to figure out if it is the Tag og Swap that fails. I hope to find this from the bootloader logs.

  • Hi Sigurd,

    Apparently I am not using any folder named as child image, I am just adding the .conf and .overlay files in build configuration. Is that a problem?

    ...

  • Aniket95 said:
    Apparently I am not using any folder named as child image, I am just adding the .conf and .overlay files in build configuration. Is that a problem?

    That will not work.

    Multi image build configurations will detect the folder child_image and apply configurations acordingly.

    Since you do not have this, my guess to the error is that you have not configured external flash for the MCUboot child image, and therefore MCUboot can not access external flash when trying to swap the images. See the child_image folder in my external flash sample  for how to configure this

  • Hi Sigurd,

    I am trying to make my project setup according to the sample example that you have provided many thanks for that. I created a child_image folder and copied .overlay and .conf file in it. When I try to enable debug logs for bootloader the flash is overflowing. It seems like I need to increase the size for mcuboot I hope that could be done by pm_static.yaml, correct?

Related