diff --git a/drivers/nble/Kconfig b/drivers/nble/Kconfig index 31e74232973..c9df72492f1 100644 --- a/drivers/nble/Kconfig +++ b/drivers/nble/Kconfig @@ -62,6 +62,18 @@ config BLUETOOTH_DEBUG default n select STDOUT_CONSOLE +config BLUETOOTH_RX_STACK_SIZE + int "Size of the receiving fiber stack" + default 1024 + range 1024 65536 + help + Size of the receiving fiber stack. This is the context from + which all event callbacks to the application occur. The + default value is sufficient for basic operation, but if the + application needs to do advanced things in its callbacks that + require extra stack space, this value can be increased to + accomodate for that. + if BLUETOOTH_DEBUG config BLUETOOTH_DEBUG_DRIVER diff --git a/drivers/nble/uart.c b/drivers/nble/uart.c index 7c288465c3a..e1973edbdd7 100644 --- a/drivers/nble/uart.c +++ b/drivers/nble/uart.c @@ -56,7 +56,7 @@ static NET_BUF_POOL(rx_pool, NBLE_RX_BUF_COUNT, NBLE_BUF_SIZE, &rx, NULL, 0); static struct nano_fifo tx; static NET_BUF_POOL(tx_pool, NBLE_TX_BUF_COUNT, NBLE_BUF_SIZE, &tx, NULL, 0); -static BT_STACK_NOINIT(rx_fiber_stack, 2048); +static BT_STACK_NOINIT(rx_fiber_stack, CONFIG_BLUETOOTH_RX_STACK_SIZE); static struct device *nble_dev; diff --git a/net/bluetooth/Kconfig b/net/bluetooth/Kconfig index fd48449565f..8dcbbcf3616 100644 --- a/net/bluetooth/Kconfig +++ b/net/bluetooth/Kconfig @@ -76,6 +76,18 @@ config BLUETOOTH_MAX_EVT_LEN Commands. It is a 3 byte Command Complete header + 65 byte return parameters = 68 bytes in total. +config BLUETOOTH_RX_STACK_SIZE + int "Size of the receiving fiber stack" + default 1024 + range 1024 65536 + help + Size of the receiving fiber stack. This is the context from + which all event callbacks to the application occur. The + default value is sufficient for basic operation, but if the + application needs to do advanced things in its callbacks that + require extra stack space, this value can be increased to + accomodate for that. + config BLUETOOTH_PERIPHERAL bool "Peripheral Role support" default n diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 1072fa9a65c..3062e78073f 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -56,7 +56,7 @@ #endif /* Stacks for the fibers */ -static BT_STACK_NOINIT(rx_fiber_stack, 1024); +static BT_STACK_NOINIT(rx_fiber_stack, CONFIG_BLUETOOTH_RX_STACK_SIZE); static BT_STACK_NOINIT(rx_prio_fiber_stack, 256); static BT_STACK_NOINIT(cmd_tx_fiber_stack, 256);