Serial recovery freezes when updating Network core

I have been trying to get DFU working on an nRF5340-based custom board. I want to be able to update the network core and application over USB using mcumgr. I would also like to be able to update the network core over Bluetooth, but the USB serial capability is more important.

I am using NCS 2.3.0.

Here is MCUBoot's configuration:

CONFIG_MCUBOOT_SERIAL=y
CONFIG_BOOT_SERIAL_CDC_ACM=y
CONFIG_BOOT_SERIAL_DETECT_DELAY=5000
CONFIG_BOOT_SERIAL_MAX_RECEIVE_SIZE=4096
CONFIG_BOOT_SERIAL_UNALIGNED_BUFFER_SIZE=128

# *snip*

CONFIG_PCD_APP=y
CONFIG_NRF53_MULTI_IMAGE_UPDATE=y
CONFIG_FLASH_SIMULATOR=y
CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y
CONFIG_FLASH_SIMULATOR_STATS=n
CONFIG_BOOT_IMAGE_ACCESS_HOOKS=y
CONFIG_UPDATEABLE_IMAGE_NUMBER=2
CONFIG_BOOT_UPGRADE_ONLY=y

# *snip*
CONFIG_PM_PARTITION_SIZE_MCUBOOT=0x14000
CONFIG_MAIN_STACK_SIZE=10304
CONFIG_BOOT_MAX_IMG_SECTORS=256

My application has the following configuration:

CONFIG_MCUMGR_CMD_OS_MGMT=y
CONFIG_MCUMGR_CMD_IMG_MGMT=y
CONFIG_MCUMGR_SMP_BT=y
CONFIG_MCUMGR=y
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_MCUMGR_SMP_BT_AUTHEN=n
CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y
CONFIG_MCUMGR_MGMT_NOTIFICATION_HOOKS=y
CONFIG_NRF53_UPGRADE_NETWORK_CORE=y
CONFIG_MCUMGR_SMP_BT_CONN_PARAM_CONTROL=y
CONFIG_MCUMGR_SMP_REASSEMBLY_BT=y

# *snip*

CONFIG_MEMFAULT=y
CONFIG_NEWLIB_LIBC=y
CONFIG_BT=y

# *snip*

I have successfully updated the application firmware using this command:

mcumgr image upload -c dev0 .\build\zephyr\app_update.bin

I am trying to use this command (from Nordic's docs) to update the network core:

mcumgr image upload -c dev0 -n 3 .\build\zephyr\net_core_app_update.bin

Here is the output of mcumgr image list:

Images:
 image=0 slot=0
    version: 3.9.2.0
    bootable: false
    flags:
    hash: Unavailable
 image=1 slot=0
    version: 0.0.0.0
    bootable: false
    flags:
    hash: Unavailable
Split status: N/A (0)

When I run this command, mcumgr's progress bar sits at 0% forever.

How do I make the network core DFU work?

Side note: yesterday, I was trying to make it work without the CONFIG_NRF32_MULTI_IMAGE_UPDATE enabled. the mcumgr command succeeded, but then the network core bootloader was failing - you can find my findings here.

Related