I am adding OTA support using mcuboot with mcumgr on a custom nrf54l15 board with the upgrade (mcuboot_secondary) partition on an external SPI nor flash (not QSPI). I am using the nrfConnect App to perform the DFU.
1.With the 2.9.1 SDK, I consistently see the image revert if I download it using "Test and Confirm." If I use "Confirm only," the upgrade works correctly and boots my image after the swap. Below are the logs showing the image revert, which occurs without ever launching my application. Note that I don’t see this behavior on a similar application running on the nRF5340. Is this a known issue with the 2.9.x SDK?
*** Booting MCUboot v2.1.0-dev-12e5ee106034 ***
*** Using nRF Connect SDK v2.9.1-60d0d6c8d42d ***
*** Using Zephyr OS v3.7.99-ca954a6216c9 ***
I: Starting bootloader
I: Primary image: magic=good, swap_type=0x3, copy_done=0x1, image_ok=0x1
I: Secondary image: magic=good, swap_type=0x2, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Image index: 0, Swap type: test
I: Starting swap using move algorithm.
I: Bootloader chainload address offset: 0xd000
*** Booting MCUboot v2.1.0-dev-12e5ee106034 ***
*** Using nRF Connect SDK v2.9.1-60d0d6c8d42d ***
*** Using Zephyr OS v3.7.99-ca954a6216c9 ***
I: Starting bootloader
I: Primary image: magic=good, swap_type=0x2, copy_done=0x1, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Image index: 0, Swap type: revert
I: Starting swap using move algorithm.
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Bootloader chainload address offset: 0xd000
I: Jumping to the first image slot
2. I tested this with the v3.0.0-rc2 SDK, and I no longer see this issue—performing the OTA with "Test and Confirm" works as expected.
However, the MCUboot image is slightly larger than in the previous SDK, so I am unable to fit it into the 0xF000 size I had allocated for the bootloader unless I disable logging.
If I increase this partition size, CONFIG_FPROTECT=y
no longer works, since the application then needs to start at 0x10000.
Do you have any suggestions for reducing the size of MCUboot while keeping logs enabled?
Below is the mcuboot.conf I am using:
3. In the MCUboot main.c
, with CONFIG_FPROTECT
enabled, this check tries to protect flash up to the start of the app partition, instead of just the end of the bootloader.
Is that intentional?
main.c
to align the protect size to the MCUboot partition size, I’m able to increase the partition size to 0xF800, enable logs, and use FPROTECT
in the bootloader. This also removes the need for the mcuboot_primary
partition to start at or below 0xF000 when FPROTECT
is enabled in the bootloader.