First one.
from the other threadâŚ
Hi there,
So are you having the Partitions, defined ? Looks like you are very close.
Itâs the Boot that is FAILING, not the DFU (LOL
Wait , your not there YET!).
usually means one of these:
The boot started, but it didnât find the APP image was invalid, Was it signed?
Is this for the DK or the XIAO..
One has an external Flash, One DOES NOT ⌠Oh the regret
his is exactly why:
- Nordic DKs â easy DFU
- XIAO â tight squeeze
SO, some Background and context for thisâŚ
There is a required 1 slot OVERWRITE needed or something to that effect
for it to work. ( Boot source: none ) tells me that.
There is a DEV academy course on this, definitely worth the Run-through.
SOAP ONâŚ
IMO, they bobbled the ball a bit on this, but in there defence the 20M wasnât available then (more IO PINS) and in an effort to quiet the complaints about battery monitoring (a major for battery powered devices & wearables) They used the pins for the Voltage divider, and missed the MAJOR advantage the extra flash provides the Chip and the User options for DFU⌠Then there was size, would another chip fit under the SHEILD? Compromises were made
I was POâd the left out the RGB LED, I love that thing
on the nRF52840..but I digress !
What to do?
So the âone-slot workaroundâ is not the normal answer for BLE OTA.
What single-slot is really for
Nordicâs docs note that single application slot / single app mode exists, but that mode is for cases where the application can only be updated by MCUboot serial recovery, not the normal slot-based OTA swap flow. Technical Documentation
single-slot / single-app â useful for serial recovery, not the usual Bluetooth OTA path
You can look up the the Reference Build flow for BLE MCUmgr DFU for Zephyr
You need to add the line that makes it build with the MCU boot in mind.
CONFIG_BOOTLOADER_MCUBOOT=y
make sure itâs signed, use a static partition map for either DK , or XIAO
âpm_static.ymlâ
The BLE OTA is limited to the FLASH size so keep that in mind if using XIAO (no external flash) It can work if the APP is small enough though.
If it wonât fit abandon BLE OTA and use serial recovery / single-app mode instead
Short Assessment âŚ
Most likely:
- You enabled DFU config
- MCUboot got built/flashed
- The actual application was not properly built/signed for MCUboot
- Bootloader came up and found garbage or unsigned content in slot 0
- So it stopped with:
Image in the primary slot is not valid
Bottom LineâŚ
That boot log means MCUboot is running, but it cannot find a valid signed application in the primary slot. Enabling CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y alone is not enough. For BLE DFU you need to build the application with MCUboot support, use a proper static partition layout with image-0 and image-1, and flash a correctly signed image. On boards without external flash, BLE OTA only works if the internal flash is large enough for both slots. If there is not enough room, then the fallback is usually MCUboot serial recovery / single-app mode rather than normal Bluetooth OTA.
BLE OTA works well on the Nrf 52840 (has ext Flash) TWO SLOTS.. normal workflow.
Normal 2 Slot; conf
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_MCUMGR=y
CONFIG_MCUMGR_TRANSPORT_BT=y
CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW=y
CONFIG_MCUMGR_CMD_IMG_MGMT=y
CONFIG_MCUMGR_CMD_OS_MGMT=y
CONFIG_IMG_MANAGER=y
CONFIG_STREAM_FLASH=y
CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME="MyDFU"
and build with SysBuild.
HTH
Gl
PJ ![]()
The bigger trade-off, in hindsight, is flash. Additional onboard flash would have opened up far more robust DFU options and long-term flexibility for developers.
It was likely a set of reasonable engineering trade-offs at the time.