got region `FLASH' overflowed by 259696 bytes error when trying to merge BLE & HTTPS CODE

Hi,

I am using SDK v2.6.1 with the nrf7002dk_nrf5340_cpuapp board.

My HTTPS code works fine, but when I try to merge the configuration files for BLE, ADC, WebSocket, and I2C into the prj.conf file, I encounter the error: FLASH overflowed by 259696.

How can I resolve this issue?

Please find my code and prj.conf file below for your reference.

# Wi-Fi
CONFIG_WIFI=y
CONFIG_WIFI_NRF700X=y
CONFIG_WPA_SUPP=y
# CONFIG_WPA_SUPP_CRYPTO_PSA=y

# Wi-Fi Credentials
CONFIG_WIFI_CREDENTIALS=y
CONFIG_WIFI_CREDENTIALS_STATIC=n

# Networking Management API
CONFIG_NET_MGMT=y
CONFIG_NET_MGMT_EVENT=y
CONFIG_NET_MGMT_EVENT_INFO=y
CONFIG_NET_MGMT_EVENT_STACK_SIZE=4096
CONFIG_NET_CONNECTION_MANAGER=y
CONFIG_WIFI_MGMT_EXT=y


# Support for shell commands
# CONFIG_SHELL=y
# CONFIG_WIFI_CREDENTIALS_SHELL=y
# CONFIG_SHELL_STACK_SIZE=4400

# Logging
CONFIG_LOG=y

# DK library
CONFIG_DK_LIBRARY=y

# System settings
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_NANO=n

# Networking
CONFIG_NETWORKING=y
CONFIG_NET_NATIVE=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_POSIX_NAMES=y
CONFIG_POSIX_MAX_FDS=16
CONFIG_NET_SOCKETS_POLL_MAX=6

CONFIG_NET_L2_ETHERNET=y
CONFIG_NET_IPV4=y
CONFIG_NET_IPV6=y
CONFIG_NET_TCP=y
CONFIG_NET_DHCPV4=y
CONFIG_DNS_RESOLVER=y


# TLS
# STEP 1.1 - Enable the TLS library and security relevant configurations
CONFIG_NET_SOCKETS_SOCKOPT_TLS=y
CONFIG_TLS_CREDENTIALS=y
CONFIG_MBEDTLS_RSA_C=y
CONFIG_MBEDTLS_DHM_C=y 

# STEP 1.2 - Enable support for server name indication (SNI)
CONFIG_MBEDTLS_SSL_SERVER_NAME_INDICATION=y

# Memory
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
CONFIG_MAIN_STACK_SIZE=4096
CONFIG_HEAP_MEM_POOL_SIZE=153600

CONFIG_NET_TCP_WORKQ_STACK_SIZE=2048
CONFIG_NET_TX_STACK_SIZE=4096
CONFIG_NET_RX_STACK_SIZE=4096
CONFIG_NET_BUF_RX_COUNT=16
CONFIG_NET_BUF_TX_COUNT=16
CONFIG_NET_BUF_DATA_SIZE=256
CONFIG_NET_TC_TX_COUNT=0

# HTTP
CONFIG_HTTP_CLIENT=y
# For storing Wi-Fi credentials
CONFIG_WIFI_CREDENTIALS_BACKEND_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y
CONFIG_SETTINGS_NVS=y

# CONFIG_NET_L2_WIFI_SHELL=y

# General
CONFIG_POSIX_CLOCK=y

# Optimize Wi-Fi stack to save some memory

CONFIG_NRF700X_MAX_TX_AGGREGATION=4

# Wi-Fi

CONFIG_WIFI_NRF700X_LOG_LEVEL_ERR=y

# WPA supplicant

CONFIG_WPA_SUPP_LOG_LEVEL_ERR=y

# Zephyr NET Connection Manager connectivity layer
CONFIG_L2_WIFI_CONNECTIVITY=y
# CONFIG_L2_WIFI_CONNECTIVITY_AUTO_DOWN=n
# CONFIG_L2_WIFI_CONNECTIVITY_AUTO_CONNECT=n

# DNS

CONFIG_NET_SOCKETS_DNS_TIMEOUT=30000

# NET sockets

CONFIG_NET_UDP=y
# CONFIG_NET_SOCKETS_OFFLOAD=n

# CONFIG_NET_CONTEXT_SNDTIMEO=y

# TLS networking
CONFIG_NET_SOCKETS_ENABLE_DTLS=n
CONFIG_NET_SOCKETS_TLS_MAX_CONTEXTS=2


# TLS credentials

# Here is the overlay I used for nrf7002dk_nrf5340_cpuapp

# CONFIG_TLS_CREDENTIALS_BACKEND_VOLATILE=y

# mbedTLS
CONFIG_NRF_SECURITY=y
CONFIG_MBEDTLS=y
CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_HEAP_SIZE=81920
CONFIG_PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY=y
CONFIG_PSA_WANT_RSA_KEY_SIZE_2048=y

CONFIG_MBEDTLS_TLS_LIBRARY=y

CONFIG_PM_SINGLE_IMAGE=y


CONFIG_WEBSOCKET_CLIENT=y
# CONFIG_NET_CONFIG_SETTINGS=y
CONFIG_NET_CONFIG_NEED_IPV4=y

# CONFIG_SPI_NOR=n

# Enable logging system
CONFIG_LOG=y



CONFIG_LOG_MODE_DEFERRED=y

# Enable DK (Development Kit) library for buttons and LEDs
CONFIG_DK_LIBRARY=y

# Enable floating-point support in CBPRINTF
CONFIG_CBPRINTF_FP_SUPPORT=y

# Enable I2C support
CONFIG_I2C=y

# Enable ADC (Analog-to-Digital Converter) support
CONFIG_ADC=y

# Enable Flash memory support
CONFIG_FLASH=y

# Enable Non-Volatile Storage (NVS) support
CONFIG_NVS=y

# Enable flash page layout configuration for NVS
CONFIG_FLASH_PAGE_LAYOUT=y

# Enable debug-level logging for NVS-related operations
CONFIG_NVS_LOG_LEVEL_DBG=y

# Enable Bluetooth Low Energy (BLE) stack
CONFIG_BT=y

# Disable SMP (Security Manager Protocol) to prevent pairing and encryption
CONFIG_BT_SMP=n

# Enable Bluetooth Peripheral role
CONFIG_BT_PERIPHERAL=y

# Set Bluetooth device name
CONFIG_BT_DEVICE_NAME="NKEY blatch"

# Enable Device Information Service (DIS)
CONFIG_BT_DIS=y

# Disable Plug and Play (PNP) feature for DIS
CONFIG_BT_DIS_PNP=n

# Set manufacturer string for the Device Information Service
CONFIG_BT_DIS_MANUF="Nexkey"

# Enable Firmware Revision in Device Information Service
CONFIG_BT_DIS_FW_REV=y

# Set Firmware Revision String for the Device Information Service
CONFIG_BT_DIS_FW_REV_STR="1.0.1"

# Enable Bootloader support for MCUBoot
CONFIG_BOOTLOADER_MCUBOOT=y

# Disable Bluetooth Over-the-Air (OTA) DFU using MCUmgr (if not needed)
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y

# Enable immediate log output
CONFIG_LOG_MODE_IMMEDIATE=y

# Allow flash writes during runtime
CONFIG_MPU_ALLOW_FLASH_WRITE=y

# Enable Watchdog timer
CONFIG_WATCHDOG=y
CONFIG_WDT_LOG_LEVEL_DBG=y
CONFIG_WDT_DISABLE_AT_BOOT=n

# Increase stack size for the main thread and system workqueue
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
CONFIG_MAIN_STACK_SIZE=2048

HTTP_BLE.zip

Related