Hi,
I am writing the firmware for a custom device based on nRF5340 (currently using NCS 2.4.1) and I working on firmware updates After quite a battle with the various configuration options for the application and MCUboot, mcuboot can update both the application core and the network core in serial recovery mode (I'm using CONFIG_NRF53_MULTI_IMAGE_UPDATE=y). However, trying to update the cores via BLE fails:
- I send the dfu_application.zip file from the build folder to my phone.
- I start the nRF Connect Device Manager (version 1.7.0) on my Samsung S20FE Android phone (running Android 13)
- The device is detected, so I select it and go to the firmware upload page (the second icon on the left in the bottom bar)
- "Select file" -> I select the dfu_application.zip image that I sent to my phone. The app correctly reports both the images (app core and net core) in this zip file.
- "Start" -> "Confirm only" (according to https://github.com/NordicSemiconductor/Android-nRF-Connect-Device-Manager , "Devices based on nRF5340 SoC support only CONFIRM_ONLY mode because the image from the Network Core cannot be read from the Application Core, making it impossible to temporarily save it.")
The application appears to upload one image (I don't know which one because there's no information about that), then resets the device, but then MCUboot reports this error:
*** Booting Zephyr OS build v3.3.99-ncs1-1 ***
I: Starting bootloader
I: Swap type: perm
E: Reset address of image in secondary slot is not in the primary slot
E: Erasing image from secondary slot
I: Swap type: none
I: Bootloader chainload address offset: 0x18000
I don't understand where this is coming from. If I unzip the dfu_application.zip file on my machine and enter serial recovery mode, I'm able to use both .bin files without issues. I am not using any static partitions (the partition manager defines and uses its own partitions). Also, the device doesn't run anything else at the moment, it just advertises over Bluetooth (using the code that I copied verbatim from zephyr/samples/subsys/mgmt/mcumgr/smp_svr/src/bluetooth.c) and then enters an infinite "while (1) k_msleep(1000);" loop.
The partition manager report looks like this:
external_flash (0x800000 - 8192kB):
+------------------------------------------------+
| 0x0: mcuboot_secondary (0xe8000 - 928kB) |
| 0xe8000: mcuboot_secondary_1 (0x40000 - 256kB) |
| 0x128000: littlefs_storage (0x100000 - 1024kB) |
| 0x228000: external_flash (0x5d8000 - 5984kB) |
+------------------------------------------------+
flash_primary (0x100000 - 1024kB):
+--------------------------------------------------+
| 0x0: mcuboot (0x15800 - 86kB) |
| 0x15800: EMPTY_0 (0x2800 - 10kB) |
+---0x18000: mcuboot_primary (0xe8000 - 928kB)-----+
| 0x18000: mcuboot_pad (0x200 - 512B) |
+---0x18200: mcuboot_primary_app (0xe7e00 - 927kB)-+
| 0x18200: app (0xe7e00 - 927kB) |
+--------------------------------------------------+
otp (0x2fc - 764B):
+------------------------------+
| 0xff8100: otp (0x2fc - 764B) |
+------------------------------+
ram_flash (0x40000 - 256kB):
+------------------------------------------+
| 0x0: mcuboot_primary_1 (0x40000 - 256kB) |
| 0x40000: ram_flash (0x0 - 0B) |
+------------------------------------------+
sram_primary (0x80000 - 512kB):
+-----------------------------------------------+
| 0x20000000: pcd_sram (0x2000 - 8kB) |
| 0x20002000: sram_primary (0x6e000 - 440kB) |
| 0x20070000: rpmsg_nrf53_sram (0x10000 - 64kB) |
+-----------------------------------------------+
CPUNET flash_primary (0x40000 - 256kB):
+--------------------------------------------+
+---0x1000000: b0n_container (0x8800 - 34kB)-+
| 0x1000000: b0n (0x8580 - 33kB) |
| 0x1008580: provision (0x280 - 640B) |
+---0x1008800: app (0x37800 - 222kB)---------+
| 0x1008800: hci_rpmsg (0x37800 - 222kB) |
+--------------------------------------------+
CPUNET sram_primary (0x10000 - 64kB):
+-------------------------------------------+
| 0x21000000: sram_primary (0x10000 - 64kB) |
+-------------------------------------------+
I know that I'm missing something, but I don't know what. Can you please let me know what I'm doing wrong? Thank you.