nRF52833 DFU OTA failing due to flash space (MCUboot dual-slot too large)

Hello,

I am working with nRF Connect SDK v3.0.2 on nRF52833 and trying to enable DFU over BLE using MCUboot.

  • I can see the device in the nRF Connect mobile app, connect to it, and attempt DFU.

  • However, the upload fails with GATT connection timeout.

Looking at the build output, my application is already very large:

FLASH: 227600 B / 232960 B (97.7%)
RAM: 49680 B / 131072 B (37.9%)

Since MCUboot with dual-slot mode requires both slot 0 and slot 1, there is not enough flash left for OTA updates.

Prj.config:

CONFIG_NCS_SAMPLES_DEFAULTS=y
CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME="SyTrakDFU_test"
CONFIG_DK_LIBRARY=y
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
# Step 2.2 - Enable FOTA over Bluetooth LE
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y

# From rtls_tags: TX Power and Stability
CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
CONFIG_BT_CTLR_CONN_RSSI=y
CONFIG_BT_CTLR_ADV_EXT=y
CONFIG_BT_CTLR_RADIO_ENABLE_FAST=y
CONFIG_BT_CTLR_TIFS_HW=y
CONFIG_BT_CTLR_CRYPTO=y
CONFIG_NRF_RTC_TIMER=y
CONFIG_CLOCK_CONTROL=y
CONFIG_CLOCK_CONTROL_NRF=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_PM=y
CONFIG_PM_DEVICE=y
CONFIG_MAIN_STACK_SIZE=2048
CONFIG_BT_BUF_ACL_TX_SIZE=251
CONFIG_BT_BUF_ACL_RX_SIZE=251
CONFIG_BT_BUF_EVT_RX_SIZE=255
CONFIG_BT_BUF_CMD_TX_SIZE=255
CONFIG_BT_CTLR_LLCP_CONN=2
CONFIG_BT_CTLR_LLCP_PER_CONN_TX_CTRL_BUF_NUM=3
CONFIG_BT_CTLR_CONN_PARAM_REQ=n
CONFIG_BT_CTLR_LE_ENC=n
CONFIG_BT_CTLR_PRIVACY=n
CONFIG_LOG=y
CONFIG_GPIO=y

My questions:

  1. Is there a recommended way to enable single-slot (overwrite-only) DFU on nRF52833 so that new images overwrite slot 0 directly?

  2. Alternatively, what are the best practices to reduce flash usage (e.g., configuration options to safely disable)?

  3. Would compression support in MCUboot help in this scenario, or is single-slot the only practical option for nRF52833?

Parents
  • Hi Sangam, 
    So what I can see in the partitions.yml is that you have the slot1 configuration as follows: 


    mcuboot_secondary:
    address: 0x45000
    end_address: 0x7e000
    placement:
    after:
    - mcuboot_primary

    The size of the slot is 0x39000=233472. 
    You will have few hundred bytes less due to over head. But that's pretty much the limit with the nRF52833. 
    Please check if your new image exceed this. 

    You have some some options: 
    - Follow what I wrote to reduce the size of the image

    - Use external flash. 

    - Try the image compression

    I don't think the single bank update on NCS will come for nRF52. But for this future feature, you will have to contact our sale representative. 

Reply
  • Hi Sangam, 
    So what I can see in the partitions.yml is that you have the slot1 configuration as follows: 


    mcuboot_secondary:
    address: 0x45000
    end_address: 0x7e000
    placement:
    after:
    - mcuboot_primary

    The size of the slot is 0x39000=233472. 
    You will have few hundred bytes less due to over head. But that's pretty much the limit with the nRF52833. 
    Please check if your new image exceed this. 

    You have some some options: 
    - Follow what I wrote to reduce the size of the image

    - Use external flash. 

    - Try the image compression

    I don't think the single bank update on NCS will come for nRF52. But for this future feature, you will have to contact our sale representative. 

Children
  • Thank you for your answer. I was able to reduce the used flash space from 97% down to 82%. However, I still need to bring it closer to 50%. From what I understand, OTA via DFU mode is only possible if the used flash size is less than 50%.

    I also checked on the Nordic forum and documentation, and found that image compression and external flash are not supported on nRF52833 – Image compression is only available on nRF54L15, nRF5340, and nRF52840.

    Could you please suggest what other methods we can apply to reduce the flash usage further?

    Are there any Nordic-specific recommendations or best practices to shrink the application image size further on nRF52833 so that OTA DFU can work?

  • Hi, 
    No you should be able to update the same application as long as you can flash it on the chip. 
    The size is already compensate for dual bank update. For example when you look here: 
    FLASH: 227600 B / 232960 B (97.7%)

    It say that your application flash is 227600 byte and it is 97.7% of the mcuboot_primary size (232960). 
    This doesn't count the secondary slot. So if you can't update the same application, there must be something else wrong. 
    I would suggest to try testing with very simple application, try doing DFU on that first. 
    Have you followed our Dev Academy guide ? 
    academy.nordicsemi.com/.../

Related