From 14f7dd918228b9caa14d0d310060bc8913fb68d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kopy=C5=9Bci=C5=84ski?= Date: Tue, 3 Nov 2020 13:28:23 +0100 Subject: [PATCH] mesh: configurable advertiser stack size Add a configurable option for advertiser thread stack size this is port of 9cc884a0d3c7a8ac4ddf476d714435f5a52e2016 --- nimble/host/mesh/src/adv.c | 5 ++--- nimble/host/mesh/syscfg.yml | 7 +++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/nimble/host/mesh/src/adv.c b/nimble/host/mesh/src/adv.c index 4bd51cc18..64555639a 100644 --- a/nimble/host/mesh/src/adv.c +++ b/nimble/host/mesh/src/adv.c @@ -44,8 +44,7 @@ static s32_t adv_int_min = ADV_INT_DEFAULT_MS; * an increased call stack whenever it's used. */ #if MYNEWT -#define ADV_STACK_SIZE 768 -OS_TASK_STACK_DEFINE(g_blemesh_stack, ADV_STACK_SIZE); +OS_TASK_STACK_DEFINE(g_blemesh_stack, MYNEWT_VAL(BLE_MESH_ADV_STACK_SIZE)); struct os_task adv_task; #endif @@ -333,7 +332,7 @@ void bt_mesh_adv_init(void) #if MYNEWT os_task_init(&adv_task, "mesh_adv", mesh_adv_thread, NULL, MYNEWT_VAL(BLE_MESH_ADV_TASK_PRIO), OS_WAIT_FOREVER, - g_blemesh_stack, ADV_STACK_SIZE); + g_blemesh_stack, MYNEWT_VAL(BLE_MESH_ADV_STACK_SIZE)); #endif /* For BT5 controllers we can have fast advertising interval */ diff --git a/nimble/host/mesh/syscfg.yml b/nimble/host/mesh/syscfg.yml index 94d457c93..197661f77 100644 --- a/nimble/host/mesh/syscfg.yml +++ b/nimble/host/mesh/syscfg.yml @@ -158,6 +158,13 @@ syscfg.defs: supported outgoing segment count (BT_MESH_TX_SEG_MAX). value: 6 + BLE_MESH_ADV_STACK_SIZE: + description: > + Mesh advertiser thread stack size. + NOTE: This is an advanced setting and should not be changed unless + absolutely necessary + value: 768 + BLE_MESH_IVU_DIVIDER: description: > When the IV Update state enters Normal operation or IV Update