From 39cd2f1cd08114586193c72ea4bbd14d7f0df8e1 Mon Sep 17 00:00:00 2001 From: shripad621git <79364691+shripad621git@users.noreply.github.com> Date: Fri, 12 Jul 2024 13:42:42 +0530 Subject: [PATCH] [ESP32] Set MAX_EVENT_QUEUE_SIZE to 40 by default for ESP32 platform (#34202) (#34309) * Set max_event_queue_size to 40 for ESP32 platform * Addressed review comments --- config/esp32/components/chip/Kconfig | 4 +++- examples/all-clusters-app/esp32/sdkconfig.defaults.esp32c2 | 3 +++ .../all-clusters-minimal-app/esp32/sdkconfig.defaults.esp32c2 | 3 +++ .../energy-management-app/esp32/sdkconfig.defaults.esp32c2 | 3 +++ examples/lighting-app/esp32/sdkconfig.defaults.esp32c2 | 3 +++ 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/config/esp32/components/chip/Kconfig b/config/esp32/components/chip/Kconfig index e2f9dcc099eba6..c742ddb0336764 100644 --- a/config/esp32/components/chip/Kconfig +++ b/config/esp32/components/chip/Kconfig @@ -330,9 +330,11 @@ menu "CHIP Device Layer" config MAX_EVENT_QUEUE_SIZE int "Max Event Queue Size" range 0 65535 - default 25 + default 40 help The maximum number of events that can be held in the CHIP Platform event queue. + Should be set greater than CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM. For SoCs other than + ESP32-C2, where the Wi-Fi buffer number is 8, recommended to use the default value. config ENABLE_EXTENDED_DISCOVERY bool "Enable Extended discovery Support" diff --git a/examples/all-clusters-app/esp32/sdkconfig.defaults.esp32c2 b/examples/all-clusters-app/esp32/sdkconfig.defaults.esp32c2 index 6cb90db4f55b9d..200dc5825bc2e2 100644 --- a/examples/all-clusters-app/esp32/sdkconfig.defaults.esp32c2 +++ b/examples/all-clusters-app/esp32/sdkconfig.defaults.esp32c2 @@ -17,3 +17,6 @@ CONFIG_BT_NIMBLE_ROLE_OBSERVER=n CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=4 CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=8 CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=16 + +# Event Queue Size +CONFIG_MAX_EVENT_QUEUE_SIZE=25 diff --git a/examples/all-clusters-minimal-app/esp32/sdkconfig.defaults.esp32c2 b/examples/all-clusters-minimal-app/esp32/sdkconfig.defaults.esp32c2 index 6cb90db4f55b9d..200dc5825bc2e2 100644 --- a/examples/all-clusters-minimal-app/esp32/sdkconfig.defaults.esp32c2 +++ b/examples/all-clusters-minimal-app/esp32/sdkconfig.defaults.esp32c2 @@ -17,3 +17,6 @@ CONFIG_BT_NIMBLE_ROLE_OBSERVER=n CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=4 CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=8 CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=16 + +# Event Queue Size +CONFIG_MAX_EVENT_QUEUE_SIZE=25 diff --git a/examples/energy-management-app/esp32/sdkconfig.defaults.esp32c2 b/examples/energy-management-app/esp32/sdkconfig.defaults.esp32c2 index 5e5d596cacb673..2347f73ec8cc6c 100644 --- a/examples/energy-management-app/esp32/sdkconfig.defaults.esp32c2 +++ b/examples/energy-management-app/esp32/sdkconfig.defaults.esp32c2 @@ -18,5 +18,8 @@ CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=4 CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=8 CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=16 +# Event Queue Size +CONFIG_MAX_EVENT_QUEUE_SIZE=25 + # Enable HKDF in mbedtls CONFIG_MBEDTLS_HKDF_C=y diff --git a/examples/lighting-app/esp32/sdkconfig.defaults.esp32c2 b/examples/lighting-app/esp32/sdkconfig.defaults.esp32c2 index 5e5d596cacb673..2347f73ec8cc6c 100644 --- a/examples/lighting-app/esp32/sdkconfig.defaults.esp32c2 +++ b/examples/lighting-app/esp32/sdkconfig.defaults.esp32c2 @@ -18,5 +18,8 @@ CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=4 CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=8 CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=16 +# Event Queue Size +CONFIG_MAX_EVENT_QUEUE_SIZE=25 + # Enable HKDF in mbedtls CONFIG_MBEDTLS_HKDF_C=y