Problem with flash overflow when adding BLE DFU on nRF52833

I'm having trouble enabling BLE DFU on my firmware for the nRF52833. I'm following the steps from the Dev Academy course - FOTA over Bluetooth Low Energy. After adding the following to my prj.conf file:

# Enable FOTA over Bluetooth LE
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y

And in the sysbuild.conf file:

# Enable MCUboot
SB_CONFIG_BOOTLOADER_MCUBOOT=y

I get the following overflow error:

/opt/nordic/ncs/toolchains/f8037e9b83/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/zephyr_pre0.elf section `rodata' will not fit in region `FLASH'
/opt/nordic/ncs/toolchains/f8037e9b83/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: region `FLASH' overflowed by 32788 bytes
collect2: error: ld returned 1 exit status

However, without the BLE OTA features, my used size region is well under what's available. I understand that MCUBoot will double the flash sized used, but even still, I should be under what's available.

Memory region         Used Size  Region Size  %age Used
           FLASH:      241768 B       488 KB     48.38%
             RAM:       52864 B       128 KB     40.33%
        IDT_LIST:          0 GB        32 KB      0.00%

I have tried removing some features in my prj.conf file, and following some recommendations in the memory footprint optimizations documentation, but the value reported in my overflow does not seem to change. Why is that? What can I try next?

Related