Title: Unable to swap DFU image in dual-slot MCUboot setup on nRF52832 (bootable: false)
Environment:
-
Board: nRF52 DK (nrf52dk_nrf52832)
-
MCUboot: v1.9.0 (built via Zephyr 3.5.99, NCS v2.5)
-
Toolchain: Zephyr SDK 0.16.5
-
West: 1.2.0
-
cmake: 3.21.0
-
Python: 3.9.13
-
mcumgr (CLI): 0.0.0-dev (Nordic-published)
-
Build command:
west build --pristine --board nrf52dk_nrf52832 \ -DCONF_FILE=debug.conf \ -DBOARD_ROOT=... c:/Projects/THZ/GWB/GWB/nrf52_application
Partition layout (pm_static.yml):
storage_partition:
address: 0x7A000
size: 0x6000
region: flash_primary
MCUboot config (child_image/mcuboot.conf):
CONFIG_MCUBOOT_SERIAL=y
CONFIG_BOOT_SERIAL_UART=y
CONFIG_BOOT_SERIAL_WAIT_FOR_DFU=y
CONFIG_BOOT_SERIAL_WAIT_FOR_DFU_TIMEOUT=5000
CONFIG_MCUBOOT_SERIAL_DIRECT_IMAGE_UPLOAD=y
CONFIG_BOOT_SWAP_USING_MOVE=y
CONFIG_BOOT_VALIDATE_SLOT0=y
CONFIG_BOOT_SERIAL_NO_APPLICATION=y
(All other defaults from NCS mcuboot.conf.)
Debug config (debug.conf, acts as prj.conf in my build configuration):
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_MCUBOOT_IMG_MANAGER=y
CONFIG_IMG_MANAGER=y
# BLE, UART, logging, GATT client, etc.
Application code:
-
main.c
callsboot_write_img_confirmed()
at startup -
No other mcuboot-specific code changes
Build outputs:
-
zephyr/app_update.bin
is generated and uploaded via:mcumgr --conntype serial --connstring "dev=COM13,baud=115200" \ image upload -n 2 debug_1/zephyr/app_update.bin
-
Upload succeeds without errors
Observed behavior:
> mcumgr ... image list
Images:
image=0 slot=0
version: 0.0.0
bootable: false
flags:
hash: bf59d59256986ab12a8ca770c8ebb5694dd69cdb26cc3ea4fc6853cb536b9992
image=0 slot=1
version: 0.0.0
bootable: false
flags:
hash: 62cf5d15a4b457ed9af4cb887def7ab1a4c2aaa00e65b3fa692bc181a9aa4925
Split status: N/A (0)
-
Both slots show bootable=false
-
Trying to test the image:
mcumgr ... image test 62cf5d15a4b457ed9af4cb887def7ab1a4c2aaa00e65b3fa692bc181a9aa4925 Error: 8
-
Error 8
indicatesMCUMGR_ERR_NOT_SUPPORTED
or invalid parameter
What I've tried (no success):
-
Adding a top-level
VERSION
file -
Enabling various
CONFIG_MCUMGR_*
options for image management
Expected behavior:
-
After upload:
-
Slot 1 should list with
bootable: true
-
-
mcumgr image test <hash>
should return success and mark the image pending swap -
On reboot, MCUboot should perform swap/move and run the new firmware
Questions:
-
Why does MCUboot list
bootable: false
despite signing with the default MCUBoot key? -
Why does
image test
returnError 8
? -
What is missing in my NCS/Zephyr build to produce a bootable image?
-
Are there any known issues or patches for Zephyr 3.5.99 mcuboot on nRF52?
Any insights into required CMake/Kconfig changes or build steps to restore proper DFU dual-slot swapping would be greatly appreciated!
— Thanks in advance for your help!