From fa9126f5e8774c7ec5252216f83d13f884b881d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalle=20Kiet=C3=A4v=C3=A4inen?= Date: Tue, 21 Jan 2025 15:41:25 +0200 Subject: [PATCH] drivers: bluetooth: hci: Increase default RX stack size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `BT_DRV_RX_STACK_SIZE` config is used by HCI drivers to determine a suitable stack size for their RX thread. These threads handle the HCI transport and pass HCI messages to the Bluetooth host via `bt_hci_recv()`. Previously, the default stack size was 256 bytes, but it seems to be too small currently. Measuring the peak stack usage of `bt_hci_recv()` in different scenarios indicates that the function needs over 300 bytes of stack. Thus, an RX thread stack size of 512 should cover that and leave some margin. Signed-off-by: Kalle Kietäväinen --- drivers/bluetooth/hci/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bluetooth/hci/Kconfig b/drivers/bluetooth/hci/Kconfig index 877802a40ef..8eb3a1ff971 100644 --- a/drivers/bluetooth/hci/Kconfig +++ b/drivers/bluetooth/hci/Kconfig @@ -295,7 +295,7 @@ config BT_DRV_RX_STACK_SIZE default BT_RX_STACK_SIZE if (BT_H4 || BT_HCI_RAW_H4) default BT_STM32_IPM_RX_STACK_SIZE if BT_STM32_IPM default HCI_NXP_RX_STACK_SIZE if HCI_NXP_RX_THREAD - default 256 + default 512 help Stack size for the HCI driver's RX thread.