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
  • Hi

    Does it act different without the "MOVE_WITHOUT_SWAP" configuration?

    Why do you use CONFIG_FLASH_LOAD_OFFSET? This configuration is normally not needed.

    Regards,
    Sigurd Hellesvik

  • Hi Sigurd,

    Does it act different without the "MOVE_WITHOUT_SWAP" configuration?

    - No I did not see any different behavior.

    - I tried to compile with CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP mode but it gives compilation errors partition manager complains about the mcuboot secondary image in external flash so I am trying with other options.

    Why do you use CONFIG_FLASH_LOAD_OFFSET?

    - I just followed this from one of the example I guess. Do you think this is the culprit?

  • Hi Sigurd,

    I have tried with eliminating the CONFIG_FLASH_LOAD_OFFSET  setting but still getting same results. The DFU package always gets loaded in slot-1(external memory partition) and I am still not able to boot the latest image.

  • Do you get bootloader logs over RTT or UART from your application?
    This sometimes gives hints to what went wrong.

    I got some unofficial bootloader samples over at https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples. 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?).

    Then when you know that both features work standalone, try to add them one by one to your app. This way we hopefully can narrow down where the issue is at.

  • 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?

    ...

Reply Children
Related