CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y

#enable BT
CONFIG_BT_ENABLED=y
CONFIG_BT_NIMBLE_ENABLED=y
CONFIG_BT_NIMBLE_ENABLE_CONN_REATTEMPT=n

# Increase some stack size
CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=7200
CONFIG_ESP_MAIN_TASK_STACK_SIZE=7200
CONFIG_ESP_TIMER_TASK_STACK_SIZE=5120
CONFIG_THREAD_TASK_STACK_SIZE=8192
CONFIG_CHIP_TASK_STACK_SIZE=10240

# partition table
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"

# USB console for Thread border board
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y

# Disable SoftAP
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n

# LWIP
CONFIG_LWIP_IPV6_FORWARD=y
CONFIG_LWIP_IPV6_AUTOCONFIG=y
CONFIG_LWIP_IPV6_NUM_ADDRESSES=12
CONFIG_LWIP_MULTICAST_PING=y
CONFIG_LWIP_NETIF_STATUS_CALLBACK=y
CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT=y
CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y
CONFIG_LWIP_HOOK_IP6_INPUT_CUSTOM=y
CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_CUSTOM=y

# ESP Border Router will also enable a route hook so we don't need the route hook in matter
CONFIG_ENABLE_ROUTE_HOOK=n

# mbedTLS
CONFIG_MBEDTLS_KEY_EXCHANGE_ECJPAKE=y
CONFIG_MBEDTLS_SSL_PROTO_DTLS=y
CONFIG_MBEDTLS_ECJPAKE_C=y
CONFIG_MBEDTLS_HKDF_C=y

# OpenThread
CONFIG_OPENTHREAD_ENABLED=y
CONFIG_OPENTHREAD_LOG_LEVEL_DYNAMIC=n
CONFIG_OPENTHREAD_LOG_LEVEL_NOTE=y
CONFIG_OPENTHREAD_SRP_CLIENT=n
CONFIG_OPENTHREAD_DNS_CLIENT=n
CONFIG_OPENTHREAD_BORDER_ROUTER=y
CONFIG_THREAD_NETWORK_COMMISSIONING_DRIVER=n
CONFIG_AUTO_UPDATE_RCP=y

#Enable chip shell
CONFIG_ENABLE_CHIP_SHELL=y

# Matter OTA
CONFIG_ENABLE_OTA_REQUESTOR=y

# Use platform mDNS
CONFIG_USE_MINIMAL_MDNS=n

# This example only use 2 dynamic endpoints
CONFIG_ESP_MATTER_MAX_DYNAMIC_ENDPOINT_COUNT=2

# Use SPIRAM and external alloc
CONFIG_SPIRAM=y
CONFIG_SPIRAM_SPEED_80M=y
CONFIG_SPIRAM_MODE_QUAD=y
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=512
CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=16384
CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y
CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_EXTERNAL=y
CONFIG_ESP_MATTER_MEM_ALLOC_MODE_EXTERNAL=y
CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
