nrf5340 DFU with external flash

Hi all,

I am working on the nrf5340 with the ncs v2.5.0. I want to to be able to update the device with BLE and through WiFI (like the aws-iot example).

To fit all this I use also an external flash (the mx25r64) which need to work as XIP.

So I added this as overlay:

/ {
    /* Configure the partition manager to use the mx25r64 external flash memory. */
    chosen {
        nordic,pm-ext-flash = &mx25r64;
    };
};

&mx25r64 {
    status = "okay";
};
And to conf

# This must be increased to accommodate the bigger images.
CONFIG_BOOT_MAX_IMG_SECTORS=256

# Serial Peripheral Interface (SPI) - Used to communicate with the mx25r64 external flash memory.
CONFIG_SPI=y
CONFIG_SPI_NOR=y
CONFIG_SPI_NOR_SFDP_DEVICETREE=y
CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y
CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y
I am working on the 7002DK, and it seems the external flash is working as expected:
[00:00:00.290,740] <inf> spi_nor: mx25r6435f@0: 8 MiBy flash
Though when I add the DFU, I get these errors

C:/ncs/v2.5.0/zephyr/drivers/flash/nrf_qspi_nor.c:69:2: error: #error "No size specified. 'size' or 'size-in-bytes' must be set"
69 | #error "No size specified. 'size' or 'size-in-bytes' must be set"

and

Could not find memory mapped address for XIP. Generated update hex files
will not have the correct base address. Hence they can not be programmed
directly to the external flash.

Am I missing some configs? Should I add a memory partions, if yes do you have an example?

Also I would like to know can we use the same Bootloader for the DFU through Wifi and BLE, do you have any recommendation for this.

Thank you,

Sylvain

Parents Reply Children
Related