Does not have enough internal flash memory on nrf5340DK + nrf7002EK to have an application that has an immutable bootloader, mcuboot as platform bootloader and a wifi example code. How to resolve this issue.

Hi,

I am using an nrf5340DK + nrf7002EK. i am able to run an example helloworld application with an immutable bootloader and mcuboot as platform bootloader. When i try to add the wifi code, im getting an error stating that the internal flash doesnt have enough memory to run the application, which is understandable. So i tried to have XIP enabled. What i see here from the memory report is that ncs folder is consuming a lot of space. Is there a way where i can relocate the entire application code and ncs code to the external flash and run the application?

This is my prj.conf. I have disabled the wifi related code for now. its just the XIP and Bootloader code that is enabled

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
###################################### BOOTLOADERS ######################################
# Print a banner on the UART on startup.
CONFIG_BOOT_BANNER=y
# Enable console and printk()
CONFIG_PRINTK=y
CONFIG_STDOUT_CONSOLE=y
# Enable Zephyr application to be booted by MCUboot
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_SECURE_BOOT=y
# CONFIG_FLASH_LOAD_OFFSET=0x00000000
# CONFIG_FLASH_LOAD_SIZE=0x800000 # Full external flash size
# Use the default MCUBoot PEM key file (BOOT_SIGNATURE_KEY_FILE)
CONFIG_MCUBOOT_SIGNATURE_KEY_FILE="bootloader/mcuboot/root-rsa-2048.pem"
# Enable SPI NOR driver
# CONFIG_SPI=y
# CONFIG_FLASH=y
# CONFIG_SPI_NOR=y
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

This is my CMakeFile

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Top-level CMakeLists.txt for the skeleton application.
#
# Copyright (c) 2017 Open Source Foundries Limited
# Copyright (c) 2018 Foundries.io Ltd
#
# SPDX-License-Identifier: Apache-2.0
#
# This provides a basic application structure suitable for loading by
# mcuboot, which is easy to customize on a per-board basis. It can be
# used as a starting point for new applications.
cmake_minimum_required(VERSION 3.8)
# find_package(Zephyr) in order to load application boilerplate:
# https://docs.zephyrproject.org/latest/develop/application/index.html
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(Test)
# This string ends up getting printed in the device console
if (NOT DEFINED FROM_WHO)
set(FROM_WHO Zephyr)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Screenshot of the memory report

This is the code.

/cfs-file/__key/communityserver-discussions-components-files/4/1586.Test.zip