#
# Copyright (c) 2023 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

CONFIG_MAIN_STACK_SIZE=10240

CONFIG_BOOT_SWAP_SAVE_ENCTLV=n
CONFIG_BOOT_BOOTSTRAP=n
CONFIG_PM=n

CONFIG_FLASH=y
CONFIG_FPROTECT=y

# Use minimal C library instead of the Picolib
CONFIG_MINIMAL_LIBC=y

# Bootloader size optimization
CONFIG_CONSOLE=n
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_USE_SEGGER_RTT=n
CONFIG_GPIO=y

CONFIG_BOOT_MAX_IMG_SECTORS=256

CONFIG_LOG=n
CONFIG_CONSOLE_HANDLER=n
CONFIG_BOOT_BANNER=n
CONFIG_NCS_BOOT_BANNER=n
CONFIG_TIMESLICING=n
CONFIG_RESET_ON_FATAL_ERROR=n
CONFIG_MULTITHREADING=n
CONFIG_TICKLESS_KERNEL=n
CONFIG_TIMEOUT_64BIT=n
CONFIG_NRF_ENABLE_ICACHE=n
CONFIG_SIZE_OPTIMIZATIONS=y

# Activate LTO
CONFIG_LTO=y
CONFIG_ISR_TABLES_LOCAL_DECLARATION=y

# General
CONFIG_FLASH=y
CONFIG_MULTITHREADING=y
CONFIG_MAIN_STACK_SIZE=4096

# Serial Peripheral Interface (SPI)
CONFIG_SPI=y
CONFIG_SPI_NOR=y
CONFIG_SPI_NOR_SFDP_DEVICETREE=y
CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096