[nRF5340+External Flash] - How to increase MCUBoot partition?

Hi there,

I am developing on nRF5340-DK using NCS. I am using the onboard external flash to hold the MCUBoot secondary image slot so that I can support larger application images.

I would like to enable some additional features in MCUBoot (Serial recovery with CDC ACM). These features mean MCUBoot does not fit in the default region of length 0xc000.

Can you please tell me how I correctly extend the size of the MCUBoot partition to fit additional features? I have done this for other Zephyr projects, however I think the addition of the external flash configuration is introducing additional overlays/configurations in the build process that are overriding my own. I cannot seem to get this 0xC000 value to change. 

The .dts files in the board directory of Zephyr do not include values which would match an external flash configuration.

My configuration:

child_image/mcuboot/boards/nrf5340dk_nrf5340_cpuapp.overlay

/ {
    chosen {
        nordic,pm-ext-flash = &mx25r64;
    };
};


child_image/mcuboot/boards/nrf5340dk_nrf5340_cpuapp.conf

# Increase main stack size
CONFIG_MAIN_STACK_SIZE=10240

# Configure logger
CONFIG_LOG=y
CONFIG_LOG_MODE_MINIMAL=y # former CONFIG_MODE_MINIMAL
CONFIG_LOG_DEFAULT_LEVEL=0
### Decrease footprint by ~4 KB in comparison to CBPRINTF_COMPLETE=y
CONFIG_CBPRINTF_NANO=y

# Configure MCUboot features
CONFIG_NRF53_MULTI_IMAGE_UPDATE=y
CONFIG_BOOT_UPGRADE_ONLY=y
CONFIG_BOOT_MAX_IMG_SECTORS=256
CONFIG_MCUBOOT_DOWNGRADE_PREVENTION=y

# Allow for storing two images in MCUboot partitions
CONFIG_UPDATEABLE_IMAGE_NUMBER=2

# Store new images inside external flash
CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y

# Enable flash simulator
CONFIG_PCD_APP=y
CONFIG_FLASH_SIMULATOR=y
CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y
CONFIG_FLASH_SIMULATOR_STATS=n

# Configure QSPI for external flash
CONFIG_FLASH=y
CONFIG_FPROTECT=y
CONFIG_NORDIC_QSPI_NOR=y
CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16

prj.conf

CONFIG_BOOTLOADER_MCUBOOT=y

# Simple Management Protocol
CONFIG_MCUMGR=y
CONFIG_MCUMGR_TRANSPORT_UART=y
CONFIG_MCUMGR_GRP_IMG=y
CONFIG_MCUMGR_GRP_OS=y
CONFIG_IMG_MANAGER=y
CONFIG_IMG_ERASE_PROGRESSIVELY=y
CONFIG_STREAM_FLASH=y
CONFIG_ZCBOR=y
CONFIG_BASE64=y

# nRF53 Network Core Updates
CONFIG_NRF53_UPGRADE_NETWORK_CORE=y
CONFIG_MCUBOOT_USE_ALL_AVAILABLE_RAM=y
CONFIG_ADD_MCUBOOT_MEDIATE_SIM_FLASH_DTS=y

Thanks,

Sean

Parents Reply Children
No Data
Related