Skip to content

Commit adc925a

Browse files
committed
konfig.nrf: Bluetooth Add SOC dependent BT_TX_PROCESSOR_STACK_SIZE
Values were derived from Thread Analyzer results. Applying SoC-specific defaults here to avoid touching upstream Zephyr files. Applications can still override via prj.conf. BT_TX_PROCESSOR_STACK_SIZE config was disabled for the samples/applications that don't have enough RAM to support it. Signed-off-by: Kyra Lengfeld <[email protected]>
1 parent 36b9f6f commit adc925a

File tree

9 files changed

+79
-0
lines changed

9 files changed

+79
-0
lines changed

Kconfig.nrf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,24 @@ config NRF_SECURITY_ENABLER
121121
imply MBEDTLS_ENABLE_HEAP if BT_HOST_CRYPTO_PRNG || BT_ECC || BT_GATT_CACHING || BT_CRYPTO
122122
depends on !SOC_NRF5340_CPUNET
123123

124+
# Bluetooth TX processor thread stack Thread Analyzer measurements
125+
# Apply SoC-specific defaults here to avoid touching upstream Zephyr files.
126+
# Applications can still override via prj.conf.
127+
configdefault BT_TX_PROCESSOR_STACK_SIZE
128+
# nRF52 variants
129+
default 768 if SOC_NRF52840
130+
default 696 if SOC_NRF52832
131+
default 969 if SOC_NRF52833
132+
# nRF53 (application core)
133+
default 688 if SOC_NRF5340_CPUAPP
134+
# nRF54H20 (application core)
135+
default 624 if SOC_NRF54H20_CPUAPP
136+
# nRF54L15 (application core)
137+
default 856 if SOC_NRF54L15_CPUAPP
138+
# nRF54L V10A / LM20A (currently application core EngA variants are used)
139+
default 856 if SOC_NRF54LV10A_ENGA_CPUAPP
140+
default 856 if SOC_NRF54LM20A_ENGA_CPUAPP
141+
124142
if SOC_SERIES_BSIM_NRFXX && ENTROPY_GENERATOR
125143
config MBEDTLS_HEAP_SIZE
126144
int

applications/nrf_desktop/Kconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,23 @@ rsource "src/hw_interface/Kconfig"
1313
rsource "src/modules/Kconfig"
1414
rsource "src/util/Kconfig"
1515
rsource "Kconfig.defaults"
16+
17+
# RAM reduction control: allow app to disable hidden Bluetooth TX processor thread.
18+
# Use an app-level switch that can be set per board in prj.conf.
19+
20+
config DESKTOP_DISABLE_BT_TX_PROCESSOR_THREAD
21+
bool "Disable BT TX processor thread to reduce RAM"
22+
help
23+
Enable this to force the Bluetooth host hidden symbol BT_TX_PROCESSOR_THREAD off.
24+
Use on very constrained RAM boards (e.g. nrf52833dk/nrf52820, nrf52820dongle/nrf52820).
25+
26+
if DESKTOP_DISABLE_BT_TX_PROCESSOR_THREAD
27+
28+
config BT_TX_PROCESSOR_THREAD
29+
bool
30+
def_bool n
31+
32+
endif
1633
endmenu
1734

1835
menu "Zephyr Kernel"

applications/nrf_desktop/configuration/nrf52820dongle_nrf52820/prj.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ CONFIG_BT_CTLR_DATA_LENGTH_MAX=35
8585

8686
CONFIG_ENTROPY_CC3XX=n
8787

88+
# Reduce RAM usage on this constrained board
89+
CONFIG_DESKTOP_DISABLE_BT_TX_PROCESSOR_THREAD=y
90+
8891
################################################################################
8992

9093
CONFIG_ASSERT=y

applications/nrf_desktop/configuration/nrf52833dk_nrf52820/prj.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ CONFIG_BT_CTLR_DATA_LENGTH_MAX=35
8686

8787
CONFIG_ENTROPY_CC3XX=n
8888

89+
# There is not enough RAM to support using this extra thread
90+
CONFIG_DESKTOP_DISABLE_BT_TX_PROCESSOR_THREAD=y
91+
8992
################################################################################
9093

9194
CONFIG_ASSERT=y

applications/nrf_desktop/configuration/nrf52833dongle_nrf52833/prj.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ CONFIG_BT_BUF_ACL_TX_SIZE=35
8080
CONFIG_BT_CTLR_DATA_LENGTH_MAX=35
8181
CONFIG_BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT=3000
8282

83+
# There is not enough RAM to support using this extra thread
84+
8385
################################################################################
8486

8587
CONFIG_ASSERT=y
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Override Bluetooth host defaults for this sample to reduce RAM usage.
2+
# We cannot modify Zephyr, so we adjust the default of the existing symbol here.
3+
# BT_TX_PROCESSOR_THREAD is a hidden (no prompt) symbol that defaults to 'y' on non-nRF51.
4+
# Provide a sample-level switch so boards can enable the reduction via their .conf.
5+
6+
config DF_CENTRAL_DISABLE_BT_TX_THREAD
7+
bool "Disable BT TX processor thread for DF central"
8+
9+
if DF_CENTRAL_DISABLE_BT_TX_THREAD
10+
11+
config BT_TX_PROCESSOR_THREAD
12+
bool
13+
def_bool n
14+
15+
endif

samples/bluetooth/direction_finding_central/boards/nrf52833dk_nrf52820.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,8 @@ CONFIG_BT_CTLR_DF_CONN_CTE_REQ=y
1515
# Ensure that there are enough control procedure contexts to queue and execute all procedures
1616
CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM=6
1717
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
18+
19+
# There is not enough RAM to support using this extra thread.
20+
# Do not set hidden Kconfig symbols in .conf files.
21+
# This is handled by the sample's Kconfig override via a sample-level switch.
22+
CONFIG_DF_CENTRAL_DISABLE_BT_TX_THREAD=y
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Override Bluetooth host defaults for this sample to reduce RAM usage.
2+
# Provide a sample-level switch so boards can enable the reduction via their .conf.
3+
4+
config DF_PERIPHERAL_DISABLE_BT_TX_THREAD
5+
bool "Disable BT TX processor thread for DF peripheral"
6+
7+
if DF_PERIPHERAL_DISABLE_BT_TX_THREAD
8+
9+
config BT_TX_PROCESSOR_THREAD
10+
bool
11+
def_bool n
12+
13+
endif

samples/bluetooth/direction_finding_peripheral/boards/nrf52833dk_nrf52820.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ CONFIG_BT_CTLR_DF_CONN_CTE_RSP=y
1313

1414
# Disable AoD Feature (antenna switching) in Tx mode in Controller
1515
CONFIG_BT_CTLR_DF_ANT_SWITCH_TX=n
16+
17+
# Reduce RAM usage on this constrained board
18+
CONFIG_DF_PERIPHERAL_DISABLE_BT_TX_THREAD=y

0 commit comments

Comments
 (0)