Reducing Flash Occupancy

Hi,

We came close to occupying all available flash memory in the nRF52833 board:

Memory region Used Size Region Size %age Used
FLASH: 185620 B 187904 B 98.78%
SRAM: 37832 B 128 KB 28.86%
IDT_LIST: 0 GB 2 KB 0.00%

After a lot of optimizations we were able to reduce it to 83%:

Memory region Used Size Region Size %age Used
FLASH: 159652 B 192000 B 83.15%
SRAM: 37512 B 128 KB 28.62%
IDT_LIST: 0 GB 2 KB 0.00%

However, we are very concerned that it might not be enough for our future needs.

Partition Manager Report shows us the following picture of flash occupancy:

We see that MCUboot occupies most of the flash - 188 x 2 KB

and that bo (nRF Secure Immutable Bootloader) another 32 KB

This leaves our app only 187KB out of 512KB flash size!

I understand that we must use MCUboot for FOTA / DFU, as we're working with nRF Connect SDK.

1. Can we drop bo?

2. Is there a way to drop the secondary slot of MCUboot?

3. Are there any additional optimizations we can make?

Many Thanks!

Vitaliy

Parents Reply Children
  • Hi Einar,

    It is already configured that way in our project, with

    CONFIG_BOOTLOADER_MCUBOOT,

    and still we get both both b0 and MCUboot.

    Here's the full prj.conf:

    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
    CONFIG_HEAP_MEM_POOL_SIZE=256
    
    # BT configuration
    CONFIG_BT=y
    #CONFIG_BT_DEBUG_LOG=y
    CONFIG_BT_SMP=y
    CONFIG_BT_SIGNING=y
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_DIS=n
    CONFIG_BT_ATT_PREPARE_COUNT=5
    CONFIG_BT_BAS=n
    CONFIG_BT_HRS=n
    CONFIG_BT_PRIVACY=y
    CONFIG_BT_DEVICE_NAME="Dride-4K"
    CONFIG_BT_DEVICE_APPEARANCE=833
    CONFIG_BT_DEVICE_NAME_DYNAMIC=y
    CONFIG_BT_DEVICE_NAME_MAX=128
    CONFIG_BT_KEYS_OVERWRITE_OLDEST=y
    CONFIG_BT_SETTINGS=y
    # FOR FOTA
    CONFIG_BT_L2CAP_TX_MTU=252
    CONFIG_BT_BUF_ACL_RX_SIZE=256
    
    CONFIG_FLASH=y
    CONFIG_SETTINGS=y
    
    # FOTA settings
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_SECURE_BOOT=y
    CONFIG_MCUMGR=y
    CONFIG_MCUMGR_CMD_OS_MGMT=y
    CONFIG_MCUMGR_CMD_IMG_MGMT=y
    CONFIG_MCUMGR_SMP_BT=y
    CONFIG_MCUMGR_SMP_BT_AUTHEN=n
    
    CONFIG_IMG_MANAGER=y
    
    CONFIG_NRFX_TEMP=y
    
    CONFIG_SERIAL=y
    CONFIG_UART_INTERRUPT_DRIVEN=y
    CONFIG_UART_USE_RUNTIME_CONFIGURE=y
    CONFIG_ADC=y
    What am I missing?
  • The only change you need for this in your config is to set CONFIG_SECURE_BOOT=n (or just remove it as n is default).

Related