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

CONFIG_SETTINGS=n

# TFM config
CONFIG_BUILD_WITH_TFM=y
CONFIG_TFM_PROFILE_TYPE_MEDIUM=y
CONFIG_TFM_LOG_LEVEL_SILENCE=y
CONFIG_TFM_IPC=y
CONFIG_TFM_ISOLATION_LEVEL=1
CONFIG_TFM_CMAKE_BUILD_TYPE_MINSIZEREL=y

# Enable nordic security backend and PSA APIs
CONFIG_NRF_SECURITY=y
CONFIG_MBEDTLS_PSA_CRYPTO_C=y
CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_HEAP_SIZE=8192
CONFIG_PSA_CRYPTO_DRIVER_OBERON=n
CONFIG_PSA_CRYPTO_DRIVER_CC3XX=y

# BT configurations
CONFIG_BT=y
CONFIG_BT_DEBUG_LOG=n
CONFIG_BT_SMP=n
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_ATT_PREPARE_COUNT=1
CONFIG_BT_DEVICE_NAME="Nordic"
CONFIG_BT_DEVICE_APPEARANCE=833
CONFIG_BT_DEVICE_NAME_DYNAMIC=n

# Update MTU size, make sure the size is always 4 bytes aligned
CONFIG_BT_L2CAP_TX_MTU=296
CONFIG_BT_BUF_ACL_RX_SIZE=296
CONFIG_BT_BUF_ACL_TX_SIZE=296

# NVS management
CONFIG_NVS=n

# Log management
CONFIG_LOG=n

# Disable NFC to use it as GPIO
CONFIG_NFCT_PINS_AS_GPIOS=y

# Enable ADC
CONFIG_ADC=y

# Setup secure bootloader
# Flash configurations
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y

# Enable MCUboot and secure bootloader for sgining the image
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_SECURE_BOOT=y

# Enable DFU target
CONFIG_DFU_TARGET=y
CONFIG_IMG_MANAGER=y
CONFIG_DFU_TARGET_MCUBOOT=y
CONFIG_DFU_TARGET_STREAM=y
CONFIG_STREAM_FLASH_ERASE=y
CONFIG_STREAM_FLASH=y
CONFIG_B0_MIN_PARTITION_SIZE=y
CONFIG_NRF53_UPGRADE_NETWORK_CORE=n

CONFIG_NRF_SPIM3_SECURE=y
CONFIG_NRF_TWIM2_SECURE=y
CONFIG_NRF_TIMER2_SECURE=y
CONFIG_NRF_PWM0_SECURE=y
CONFIG_NRF_TIMER1_SECURE=y
CONFIG_NRF_PWM1_SECURE=y
CONFIG_NRF_GPIOTE0_SECURE=y
CONFIG_NRF_TIMER0_SECURE=y
