DFU on nrf52832

Hi, I am having problem making DFU work on nrf52832 using nrf connect sdk 2.6.0.  Below is my mcuboot.conf under child_image and prj.conf. Please guide me where I am wrong. Also when I set CONFIG_SINGLE_APPLICATION_SLOT, it builds fine but when I disables it, it doesn't build due to size issue.

&flash0 {

partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0xC000>;
};
slot0_partition: partition@C000 {
label = "image-0";
reg = <0x0000C000 0x2C000>;
};
slot1_partition: partition@38000 {
label = "image-1";
reg = <0x00038000 0x2C000>;
};
storage_partition: partition@64000 {
label = "storage";
reg = <0x00064000 0x4000>;
};
};

};
# Logging
CONFIG_LOG=y
CONFIG_MCUBOOT_LOG_LEVEL_WRN=y
# CONFIG_PM_PARTITION_SIZE_MCUBOOT=0x15000
CONFIG_SINGLE_APPLICATION_SLOT=y

and prj.conf
#
# Copyright (C) 2024 Walk With Path Corp. All Rights Reserved.
# Project Configuration File
#
# This file contains configuration settings for Bluetooth, logging, peripherals,
# memory optimization, DFU support, and other key features for Zephyr-based applications.
#

# ==============================
# General Debugging and Logging
# ==============================

CONFIG_LOG=y # Enable logging framework
CONFIG_LOG_BACKEND_UART=y # Use UART backend for logs
CONFIG_LOG_PRINTK=y # Allow printk for logs
CONFIG_CBPRINTF_FP_SUPPORT=y # Enable floating-point support in logs

# Enable console for debug purposes
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

CONFIG_DEBUG=y # Enable debugging
CONFIG_PRINTK=y # Enable printk debugging

CONFIG_SHELL=n # Enable Zephyr Shell for debugging
CONFIG_SHELL_LOG_BACKEND=y
CONFIG_SHELL_CMD_BUFF_SIZE=128

# Enable RTT (Real-Time Transfer) for logs (alternative to UART)
CONFIG_USE_SEGGER_RTT=y
CONFIG_LOG_BACKEND_RTT=y
CONFIG_RTT_CONSOLE=y
CONFIG_UART_CONSOLE=y # Disable UART console if RTT is enabled
CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=512
CONFIG_SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL=y

CONFIG_LOG_BLOCK_IN_THREAD=y
CONFIG_LOG_BUFFER_SIZE=256
CONFIG_DEBUG=y # Enable debugging
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_THREAD_INFO=y

# CONFIG_NCS_BOOT_BANNER=y # Enable NCS boot banner
CONFIG_BOOT_BANNER=y
CONFIG_PRINTK=y

# Enable UART support
CONFIG_SERIAL=y

# ==============================
# Peripheral and Sensor Drivers
# ==============================

CONFIG_I2C=y # Enable I2C interface
CONFIG_SPI=y # Enable SPI interface
CONFIG_ADC=y # Enable ADC driver

CONFIG_SENSOR=y # Enable generic sensor support
CONFIG_TMP116=y # Enable TMP116 temperature sensor
CONFIG_BMI270=y # Enable BMI270 accelerometer
CONFIG_BMI270_TRIGGER_GLOBAL_THREAD=y

CONFIG_WATCHDOG=y # Enable watchdog timer
CONFIG_WDT_LOG_LEVEL_DBG=y
CONFIG_WDT_DISABLE_AT_BOOT=n

# Enable LED and regulator drivers
CONFIG_LED=y
CONFIG_REGULATOR=y

# Enable power management IC (NPMX)
# CONFIG_NPMX=y
# CONFIG_NPMX_DEVICE_NPM1300=y

# Enable Nordic Fuel Gauge and BMI270 (Accelerometer and Gyroscope)
CONFIG_NRF_FUEL_GAUGE=y

# Disable SPI NOR flash driver (if not used)
CONFIG_SPI_NOR=n

# ==============================
# Power and Memory Optimizations
# ==============================

# Power management configuration
CONFIG_PM_DEVICE=y
CONFIG_PM_DEVICE_RUNTIME=y

# ==============================
# Memory Optimizations
# ==============================

# Configure memory pool and stack sizes
CONFIG_MAIN_STACK_SIZE=2048
CONFIG_HEAP_MEM_POOL_SIZE=1024

# ==============================
# Flash Configuration
# ==============================

CONFIG_FLASH=y # Enable flash memory support
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y

CONFIG_BT_SETTINGS=y # Enable Bluetooth settings
CONFIG_SETTINGS=y # Enable settings subsystem
CONFIG_NVS=y # Enable Non-Volatile Storage
CONFIG_NVS_LOG_LEVEL_DBG=y

# ==============================
# Bluetooth Settings
# ==============================

CONFIG_NCS_SAMPLES_DEFAULTS=y

# Enable Bluetooth and controller settings
CONFIG_BT=y
CONFIG_BT_HCI=y
CONFIG_BT_CTLR=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_BROADCASTER=n
CONFIG_BT_SMP=y
CONFIG_BT_BONDABLE=y
CONFIG_BT_CTLR_ADV_EXT=n
CONFIG_BT_DEVICE_APPEARANCE=1345
CONFIG_BT_DEVICE_NAME_DYNAMIC=y
CONFIG_BT_GATT_CLIENT=y

# Bluetooth security and bonding settings
CONFIG_BT_KEYS_OVERWRITE_OLDEST=y
CONFIG_BT_SMP_ALLOW_UNAUTH_OVERWRITE=y
CONFIG_BT_ID_UNPAIR_MATCHING_BONDS=y
CONFIG_BT_PRIVACY=n
CONFIG_BT_TINYCRYPT_ECC=y
CONFIG_BT_CTLR_PHY_2M=y
CONFIG_BT_USER_PHY_UPDATE=y

# Bluetooth buffer and connection settings
CONFIG_BT_BUF_ACL_RX_SIZE=247
CONFIG_BT_ATT_PREPARE_COUNT=2
CONFIG_BT_BUF_ACL_TX_SIZE=256
CONFIG_BT_BUF_ACL_TX_COUNT=10
CONFIG_BT_L2CAP_TX_MTU=247
CONFIG_BT_L2CAP_TX_BUF_COUNT=10
CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y
CONFIG_BT_CTLR_DATA_LENGTH_MAX=247
CONFIG_BT_CTLR_RX_BUFFERS=2
CONFIG_BT_CONN_TX_MAX=10
CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=n

CONFIG_BT_GATT_DM=y

# Allow only LESC pairing
# CONFIG_BT_SMP_SC_PAIR_ONLY=y

# Configure Bluetooth connection settings
CONFIG_BT_CTLR_TX_PWR_0=y
CONFIG_BT_MAX_CONN=1
CONFIG_BT_MAX_PAIRED=1

# Enable PHY updates
CONFIG_BT_USER_PHY_UPDATE=y
CONFIG_BT_USER_DATA_LEN_UPDATE=y

# Enable Bluetooth shell for debugging
CONFIG_BT_SHELL=n

# Enable BT NUS (Nordic UART Service) shell for testing
# CONFIG_SHELL_BT_NUS=y

# Enable Battery Service (BAS) for battery level reporting
CONFIG_BT_BAS=y

# ==============================
# Cryptography
# ==============================

CONFIG_TINYCRYPT=y # Enable TinyCrypt for secure operations
CONFIG_BT_TINYCRYPT_ECC=y

# ==============================
# Reboot and Misc Settings
# ==============================

CONFIG_REBOOT=y # Enable reboot functionality

# ==============================
# DFU Support and Bootloader
# ==============================

# Enable mcumgr.
CONFIG_MCUMGR=y

# Enable MCUboot and FOTA
CONFIG_BOOTLOADER_MCUBOOT=y
# CONFIG_MCUBOOT_SIGNATURE_KEY_FILE="bootloader/mcuboot/root-rsa-2048.pem"
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP=y

# Enable image management
CONFIG_MCUMGR_TRANSPORT_BT=y
CONFIG_MCUMGR_TRANSPORT_BT_AUTHEN=n
CONFIG_MCUMGR_TRANSPORT_BT_CONN_PARAM_CONTROL=y

CONFIG_IMG_MANAGER=n
CONFIG_MCUBOOT_IMG_MANAGER=y
CONFIG_IMG_ERASE_PROGRESSIVELY=y

# Enable logging for mcumgr (DFU)
CONFIG_MCUMGR_LOG_LEVEL_DBG=y
CONFIG_MCUMGR_LOG_LEVEL_INF=y

# Enable logging for image management subsystem
CONFIG_IMG_MANAGER_LOG_LEVEL_DBG=y
CONFIG_IMG_MANAGER_LOG_LEVEL_INF=y

# # Enable mcumgr DFU in application
# # Enable MCUMGR

# # Enable MCUMGR management for both OS and Images
# CONFIG_MCUMGR_GRP_OS=y
# CONFIG_MCUMGR_GRP_IMG=y

# Support for taskstat command
CONFIG_MCUMGR_GRP_OS_TASKSTAT=y

# Enable statistics and statistic names.
CONFIG_STATS=y
CONFIG_STATS_NAMES=y

# Enable most core commands.
CONFIG_MCUMGR_GRP_IMG=y
CONFIG_MCUMGR_GRP_OS=y
CONFIG_MCUMGR_GRP_STAT=y


Related