nRF5340 Getting FOTA to work with both app core and net core simultaneously

Hello,

I've been working on getting FOTA to work for multi-image DFUs, but have not been able to get it. I've read through countless forums, and something I heard was that we need external flash to DFU both the app and net core. However, a coworker told me he was able to partition the internal flash on our DK boards to support FOTAing without external flashing. He's not sure how to do it on v2.4.2, though. If you have any information on how we could do this in 2.4.2, that would be great!

I've followed a few samples to get simultaneous FOTA working, such as this one https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/nrf5340/mcuboot_smp_ble_simultaneous . My DK board had weird functionality with this project. When I would first start the DFU, after I clicked "Confirm and Test" in the nRF Device Manager iOS mobile app, I would get an error saying "Unable to find secondary slot for image 0 in Test Response" for the "State". After, I would click "Start" and "Confirm and Test" a second time, and then it would very quickly finish and say "UPLOAD COMPLETE." This seems to mean that it worked, but I'm not certain.

For my own project, currently I'm able to build and flash my board, but I can't see it being listed as a Bluetooth device to connect to.

Here is my prj.conf file:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Enable Bootloader
CONFIG_BOOTLOADER_MCUBOOT=y
# Enable SMP Server
CONFIG_MCUMGR=y
CONFIG_BASE64=y
CONFIG_MCUMGR_TRANSPORT_UART=y
CONFIG_MCUMGR_GRP_IMG=y
# Enable BLE transfer
CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME="Test SMP Server"
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_MCUBOOT_USE_ALL_AVAILABLE_RAM=y
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP=y
CONFIG_MCUBOOT_IMAGE_VERSION="2.3.0+0"
CONFIG_NRF53_UPGRADE_NETWORK_CORE=y
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Here is my mcuboot.conf file:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
CONFIG_BOOT_SIGNATURE_KEY_FILE="C:/Users/NolanGeer/Documents/GitHub/nrf5340_firmware/keys/nirskey.pem"
# Enable flash simulator
CONFIG_FLASH_SIMULATOR=y
CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y
CONFIG_FLASH_SIMULATOR_STATS=n
CONFIG_NORDIC_QSPI_NOR=y
CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16
CONFIG_MAIN_STACK_SIZE=10240
CONFIG_BOOT_MAX_IMG_SECTORS=256
CONFIG_NRF53_MULTI_IMAGE_UPDATE=y
CONFIG_UPDATEABLE_IMAGE_NUMBER=2
CONFIG_BOOT_UPGRADE_ONLY=y
CONFIG_BOOT_IMAGE_ACCESS_HOOK_NRF5340=y
CONFIG_BOOT_IMAGE_ACCESS_HOOKS=y
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Here is my overlay file:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// To get started, press Ctrl+Space to bring up the completion menu and view the available nodes.
// You can also use the buttons in the sidebar to perform actions on nodes.
// Actions currently available include:
// * Enabling / disabling the node
// * Adding the bus to a bus
// * Removing the node
// * Connecting ADC channels
// For more help, browse the DeviceTree documentation at https://docs.zephyrproject.org/latest/guides/dts/index.html
// You can also visit the nRF DeviceTree extension documentation at https://nrfconnect.github.io/vscode-nrf-connect/devicetree/nrfdevicetree.html
/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};
/ {
zephyr,user {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I also have a .conf file for the NSIB first-stage bootloader (hci_rpmsg.conf)

Fullscreen
1
2
CONFIG_SECURE_BOOT=y
CONFIG_SB_SIGNING_KEY_FILE="C:/Users/NolanGeer/Documents/GitHub/nrf5340_firmware/keys/nirskey_ecdsa.pem"
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Finally, I also have an overlay file for my mcuboot, named mcuboot.overlay, but I don't think it's doing anything. I'm not sure about this, but I saw it in the example I linked above.

Fullscreen
1
2
3
4
5
/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I have another version of my project where I could connect to the Bluetooth and start the FOTA, but I would get the error: Invalid value(3). I wasn't sure what this meant, so I moved onto trying to copy the sample.

Let me know if you need any other information. I've read through quite a bit of forum posts to no avail, so hopefully we can figure this out.

Thanks in advance!