CONFIG_BT=y
CONFIG_BT_DEVICE_NAME_DYNAMIC=y
CONFIG_BT_GATT_DYNAMIC_DB=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_CENTRAL=y
CONFIG_BT_GATT_CLIENT=y
CONFIG_BT_L2CAP_TX_MTU=252
CONFIG_BT_BUF_ACL_RX_SIZE=256

# CONFIG_MICROPY_HEAP_SIZE=98304
CONFIG_MAIN_STACK_SIZE=8192

CONFIG_MICROPY_HEAP_SIZE=32768
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=8192
CONFIG_HEAP_MEM_POOL_SIZE=65536


# CONFIG_DYNAMIC_THREAD=y
CONFIG_THREAD_CUSTOM_DATA=y
CONFIG_THREAD_MONITOR=y
CONFIG_THREAD_STACK_INFO=y
CONFIG_THREAD_NAME=y

CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_MICROPY_CONFIGFILE="mpconfigport_full.h"

# Enable Bootloader
# CONFIG_BOOTLOADER_MCUBOOT=y
# CONFIG_IMG_MANAGER=y
# CONFIG_STREAM_FLASH=y
# CONFIG_DFU_TARGET_MCUBOOT=y
# CONFIG_IMG_ERASE_PROGRESSIVELY=y

# Enable SMP Server
# CONFIG_MCUMGR=y
# CONFIG_MCUMGR_GRP_IMG=y

# # CONFIG_MCUMGR_GRP_IMG dependencies
# CONFIG_FLASH=y
# CONFIG_IMG_MANAGER=y

# # CONFIG_IMG_MANAGER dependencies
# # CONFIG_STREAM_FLASH=y

# # CONFIG_MCUMGR dependencies
# CONFIG_NET_BUF=y
# CONFIG_ZCBOR=y

# Required for CONFIG_IMG_MANAGER
# CONFIG_FLASH_MAP=y

# Enable BLE transfer
CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y

CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
CONFIG_CBPRINTF_FP_SUPPORT=y

# # LoRaWAN config
# CONFIG_LORA_SX126X=y
CONFIG_SPI=y

# CONFIG_LORA=y

# Random number generator required for several LoRaWAN services
CONFIG_ENTROPY_GENERATOR=y

# # LoRaWAN application layer
# CONFIG_LORAWAN=y
# CONFIG_LORAMAC_REGION_EU868=y
# CONFIG_LORAWAN_NVM_SETTINGS=y

# # LoRaWAN services required for FUOTA
# CONFIG_LORAWAN_SERVICES=y
# CONFIG_LORAWAN_APP_CLOCK_SYNC=y
#CONFIG_LORAWAN_REMOTE_MULTICAST=y
#CONFIG_LORAWAN_FRAG_TRANSPORT=y

# Flash driver to store firmware image
# CONFIG_FLASH=y
# # CONFIG_FLASH_MAP=y
# # CONFIG_FLASH_PAGE_LAYOUT=y
# CONFIG_STREAM_FLASH=y

CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP=y

CONFIG_NFC_T2T_NRFXLIB=y

CONFIG_NFC_NDEF=y
CONFIG_NFC_NDEF_MSG=y
CONFIG_NFC_NDEF_RECORD=y
CONFIG_NFC_NDEF_LE_OOB_REC=y
CONFIG_NFC_NDEF_CH_MSG=y
CONFIG_NFC_NDEF_TEXT_RECORD=y

CONFIG_NFC_NDEF_TNEP_RECORD=y
CONFIG_NFC_TNEP_TAG=y
CONFIG_NFC_NDEF_PARSER=y
CONFIG_NFC_NDEF_CH_PARSER=y
CONFIG_NFC_NDEF_LE_OOB_REC_PARSER=y
CONFIG_NFC_TNEP_CH=y

# CONFIG_HEAP_MEM_POOL_SIZE=8192

CONFIG_ARM_TRUSTZONE_M=y
CONFIG_BUILD_WITH_TFM=y

CONFIG_TFM_PROFILE_TYPE_MINIMAL=y
# CONFIG_TFM_PROFILE_TYPE_NOT_SET=y

CONFIG_WIFI_NM_WPA_SUPPLICANT=y
CONFIG_NRF70_AP_MODE=n
CONFIG_NRF70_P2P_MODE=n
CONFIG_NET_PKT_TX_COUNT=6
CONFIG_NET_PKT_RX_COUNT=6
CONFIG_NET_BUF_TX_COUNT=12
CONFIG_NET_BUF_RX_COUNT=6
CONFIG_NRF70_RX_NUM_BUFS=6
CONFIG_NET_BUF_DATA_SIZE=500
# CONFIG_HEAP_MEM_POOL_SIZE=230000
CONFIG_HEAP_MEM_POOL_SIZE=120000
CONFIG_SPEED_OPTIMIZATIONS=y
CONFIG_NRF70_UTIL=n
CONFIG_NRF70_MAX_TX_AGGREGATION=1
CONFIG_NRF70_MAX_TX_TOKENS=5

# # Enable MCUmgr and dependencies.
# CONFIG_NET_BUF=y
# CONFIG_ZCBOR=y
# CONFIG_CRC=y
# CONFIG_MCUMGR=y
# CONFIG_STREAM_FLASH=y
# CONFIG_FLASH_MAP=y

# Some command handlers require a large stack.
# CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096

# Ensure an MCUboot-compatible binary is generated.
# CONFIG_BOOTLOADER_MCUBOOT=y

# Enable flash operations.
# CONFIG_FLASH=y

# Required by the `taskstat` command.
# CONFIG_THREAD_MONITOR=y

# # Support for taskstat command
# CONFIG_MCUMGR_GRP_OS_TASKSTAT=y

# # Enable statistics and statistic names.
# CONFIG_STATS=y
# CONFIG_STATS_NAMES=y

# # Enable most core commands.
# CONFIG_FLASH=y
# CONFIG_IMG_MANAGER=y
# CONFIG_MCUMGR_GRP_IMG=y
# CONFIG_MCUMGR_GRP_OS=y
# CONFIG_MCUMGR_GRP_STAT=y

# # Disable debug logging
# CONFIG_LOG_MAX_LEVEL=3

CONFIG_WATCHDOG=y
CONFIG_WDT_DISABLE_AT_BOOT=y

CONFIG_COUNTER=y

CONFIG_ENTROPY_GENERATOR=y

# Enable nordic security backend and PSA APIs
CONFIG_NRF_SECURITY=y
CONFIG_MBEDTLS_PSA_CRYPTO_C=y

CONFIG_PSA_WANT_GENERATE_RANDOM=y

# Using hardware crypto accelerator
CONFIG_PSA_CRYPTO_DRIVER_OBERON=n
CONFIG_PSA_CRYPTO_DRIVER_CC3XX=y

# Mbedtls configuration
CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_HEAP_SIZE=8192

CONFIG_NRF_SECURITY=y
CONFIG_MBEDTLS_RSA_C=y
CONFIG_MBEDTLS_CFG_FILE="nrf-config.h"
CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_USER_CONFIG_FILE="nrf_mbedtls_config.h"

CONFIG_PWM=y


# WPA supplicant
CONFIG_WIFI_NM_WPA_SUPPLICANT=y
CONFIG_WIFI_READY_LIB=y
CONFIG_NRF_WIFI_RPU_RECOVERY=y

# Networking
CONFIG_NETWORKING=y
CONFIG_WIFI=y
CONFIG_WIFI_NRF70=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_IPV4=y
CONFIG_NET_UDP=y
CONFIG_NET_TCP=y
CONFIG_NET_DHCPV4=y

# ~~~~~~~~~~~~~~~~~~~~~~~~~
CONFIG_WIFI_MGMT_EXT=y
CONFIG_WIFI_CREDENTIALS=y
CONFIG_WIFI_CREDENTIALS_STATIC=y
CONFIG_WIFI_CREDENTIALS_STATIC_SSID="RT"
CONFIG_WIFI_CREDENTIALS_STATIC_PASSWORD="WelcomeToTheFuture"
CONFIG_WIFI_CREDENTIALS_STATIC_TYPE_SAE=y

# # Networking
# CONFIG_NETWORKING=y
# CONFIG_NET_SOCKETS=y
# CONFIG_NET_LOG=y
# CONFIG_NET_IPV4=y
# CONFIG_NET_UDP=y
# CONFIG_NET_TCP=y
# CONFIG_NET_DHCPV4=y

# CONFIG_NET_PKT_RX_COUNT=8
# CONFIG_NET_PKT_TX_COUNT=8

# # Below section is the primary contributor to SRAM and is currently
# # tuned for performance, but this will be revisited in the future.
# CONFIG_NET_BUF_RX_COUNT=8
# CONFIG_NET_BUF_TX_COUNT=16
# CONFIG_NRF70_RX_NUM_BUFS=16
# CONFIG_HEAP_MEM_POOL_SIZE=120000
# CONFIG_HEAP_MEM_POOL_IGNORE_MIN=y
# CONFIG_NET_TC_TX_COUNT=1

# CONFIG_NET_IF_UNICAST_IPV4_ADDR_COUNT=1
# CONFIG_NET_MAX_CONTEXTS=5
# CONFIG_NET_CONTEXT_SYNC_RECV=y

# CONFIG_INIT_STACKS=y

# CONFIG_NET_L2_ETHERNET=y

# CONFIG_NET_CONFIG_SETTINGS=y
# CONFIG_NET_CONFIG_INIT_TIMEOUT=0

# CONFIG_NET_SOCKETS_POLL_MAX=10

# # Memories
# CONFIG_MAIN_STACK_SIZE=5200
# CONFIG_NET_TX_STACK_SIZE=4096
# CONFIG_NET_RX_STACK_SIZE=4096
# CONFIG_STA_SAMPLE_START_WIFI_THREAD_STACK_SIZE=5200

# # Debugging
# CONFIG_STACK_SENTINEL=y
# CONFIG_DEBUG_COREDUMP=y
# CONFIG_DEBUG_COREDUMP_BACKEND_LOGGING=y
# CONFIG_DEBUG_COREDUMP_MEMORY_DUMP_MIN=y
# CONFIG_SHELL_CMDS_RESIZE=n


# # Kernel options
# CONFIG_ENTROPY_GENERATOR=y

# # Logging
# CONFIG_LOG=y
# CONFIG_LOG_BUFFER_SIZE=2048
# CONFIG_POSIX_CLOCK=y

# CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.168.1.99"
# CONFIG_NET_CONFIG_MY_IPV4_NETMASK="255.255.255.0"
# CONFIG_NET_CONFIG_MY_IPV4_GW="192.168.1.1"

# # printing of scan results puts pressure on queues in new locking
# # design in net_mgmt. So, use a higher timeout for a crowded
# # environment.
# CONFIG_NET_MGMT_EVENT_QUEUE_TIMEOUT=5000
# # ~~~~~~~~~~~~~~~~~~~~~~~~~

CONFIG_NET_PKT_RX_COUNT=16
CONFIG_NET_PKT_TX_COUNT=16
CONFIG_NRF70_RX_NUM_BUFS=16

# Below section is the primary contributor to SRAM and is currently
# tuned for performance, but this will be revisited in the future.
CONFIG_NET_BUF_RX_COUNT=16
CONFIG_NET_BUF_TX_COUNT=32
# CONFIG_HEAP_MEM_POOL_SIZE=37000
CONFIG_HEAP_MEM_POOL_IGNORE_MIN=y   
CONFIG_NET_TC_TX_COUNT=1

CONFIG_NET_IF_UNICAST_IPV4_ADDR_COUNT=1
CONFIG_NET_MAX_CONTEXTS=5
CONFIG_NET_CONTEXT_SYNC_RECV=y

CONFIG_INIT_STACKS=y

CONFIG_NET_L2_ETHERNET=y

CONFIG_NET_CONFIG_SETTINGS=y
CONFIG_NET_CONFIG_INIT_TIMEOUT=0

CONFIG_NET_SOCKETS_POLL_MAX=10

# Memories
CONFIG_MAIN_STACK_SIZE=5200
CONFIG_NET_TX_STACK_SIZE=4096
CONFIG_NET_RX_STACK_SIZE=4096

# Debugging
CONFIG_STACK_SENTINEL=y
CONFIG_DEBUG_COREDUMP=y
CONFIG_DEBUG_COREDUMP_BACKEND_LOGGING=y
CONFIG_DEBUG_COREDUMP_MEMORY_DUMP_MIN=y
CONFIG_SHELL_CMDS_RESIZE=n

# Kernel options
CONFIG_ENTROPY_GENERATOR=y

# Logging
CONFIG_LOG=y
# CONFIG_MCUBOOT_UTIL_LOG_LEVEL_WRN=y
# CONFIG_LOG_BUFFER_SIZE=2048
CONFIG_LOG_BUFFER_SIZE=16384
# CONFIG_POSIX_CLOCK=y
CONFIG_NET_LOG=y
CONFIG_WIFI_LOG_LEVEL_DBG=y
# CONFIG_NET_L2_WIFI_MGMT_LOG_LEVEL_DBG=y

# # Makes logs immediate (can cause race conditions!)
# CONFIG_LOG_MODE_IMMEDIATE=y
# # Global override for the log level of all modules (!warning!: will flood the CLI so much it will eventually lead to a USAGE FAULT / Stack overflow)
# CONFIG_LOG_OVERRIDE_LEVEL=4

CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.168.1.99"
CONFIG_NET_CONFIG_MY_IPV4_NETMASK="255.255.255.0"
CONFIG_NET_CONFIG_MY_IPV4_GW="192.168.1.1"

# printing of scan results puts pressure on queues in new locking
# design in net_mgmt. So, use a higher timeout for a crowded
# environment.
CONFIG_NET_MGMT_EVENT_QUEUE_TIMEOUT=5000

CONFIG_WIFI_CREDENTIALS=y
CONFIG_WIFI_CREDENTIALS_STATIC=y
CONFIG_WIFI_CREDENTIALS_STATIC_SSID="RT"
CONFIG_WIFI_CREDENTIALS_STATIC_PASSWORD="WelcomeToTheFuture"

# Use Nordic mbedTLS config
CONFIG_MBEDTLS_CFG_FILE="nrf-config.h"
CONFIG_MBEDTLS_USER_CONFIG_FILE="nrf_mbedtls_config.h"
CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_USE_PSA_CRYPTO=y
CONFIG_NRF_SECURITY=y
CONFIG_MBEDTLS_LEGACY_CRYPTO_C=y
CONFIG_PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY=y
CONFIG_PSA_WANT_RSA_KEY_SIZE_2048=y
#CONFIG_NORDIC_SECURITY_BACKEND=y
CONFIG_MBEDTLS=y
#CONFIG_MBEDTLS_TLS_LIBRARY=y
CONFIG_MBEDTLS_RSA_C=y

CONFIG_NET_MGMT_EVENT=y
CONFIG_NET_L2_WIFI_MGMT=y
