From 322b177549b65d083347a025072fc2ac1dfbc657 Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Thu, 21 Nov 2024 16:00:56 +0100 Subject: [PATCH] samples: Bluetooth: Reduce heap for hci_ipc Reducing the heap requirement for the hci_ipc sample from 8KiB to 4KiB. It has been tested in various configurations to work with 2300, but 4KiB was used to provide some leeway for future updates. The heap requirement is not documented, and it is unclear why values lower than 2300 (not exact number) won't boot, and should be investigated further. Memory has become a very scarce resource for especially the ISO builds for the nRF5340, which is why this is getting reduced. Signed-off-by: Emil Gydesen --- .../bluetooth/hci_ipc/nrf5340_cpunet_bis-bt_ll_sw_split.conf | 2 +- .../hci_ipc/nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf | 2 +- .../bluetooth/hci_ipc/nrf5340_cpunet_cis-bt_ll_sw_split.conf | 2 +- .../bluetooth/hci_ipc/nrf5340_cpunet_df-bt_ll_sw_split.conf | 2 +- .../bluetooth/hci_ipc/nrf5340_cpunet_iso-bt_ll_sw_split.conf | 2 +- .../hci_ipc/nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf | 2 +- .../hci_ipc/nrf5340_cpunet_iso_central-bt_ll_sw_split.conf | 2 +- .../hci_ipc/nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf | 2 +- .../hci_ipc/nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf | 2 +- samples/bluetooth/hci_ipc/prj.conf | 2 +- tests/bluetooth/tester/nrf5340_hci_ipc_cpunet.conf | 3 --- .../hci_ipc/nrf5340_cpunet_iso_acl_group-bt_ll_sw_split.conf | 2 +- 12 files changed, 11 insertions(+), 14 deletions(-) diff --git a/samples/bluetooth/hci_ipc/nrf5340_cpunet_bis-bt_ll_sw_split.conf b/samples/bluetooth/hci_ipc/nrf5340_cpunet_bis-bt_ll_sw_split.conf index 13b4268e165..f58d44035a7 100644 --- a/samples/bluetooth/hci_ipc/nrf5340_cpunet_bis-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_ipc/nrf5340_cpunet_bis-bt_ll_sw_split.conf @@ -5,7 +5,7 @@ CONFIG_ISR_STACK_SIZE=1024 CONFIG_IDLE_STACK_SIZE=256 CONFIG_MAIN_STACK_SIZE=512 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 -CONFIG_HEAP_MEM_POOL_SIZE=6144 +CONFIG_HEAP_MEM_POOL_SIZE=4096 CONFIG_BT=y CONFIG_BT_HCI_RAW=y diff --git a/samples/bluetooth/hci_ipc/nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf b/samples/bluetooth/hci_ipc/nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf index 8cc6ac936c9..8a031231c5a 100644 --- a/samples/bluetooth/hci_ipc/nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_ipc/nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf @@ -1,7 +1,7 @@ CONFIG_IPC_SERVICE=y CONFIG_MBOX=y -CONFIG_HEAP_MEM_POOL_SIZE=6144 +CONFIG_HEAP_MEM_POOL_SIZE=4096 CONFIG_MAIN_STACK_SIZE=512 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 diff --git a/samples/bluetooth/hci_ipc/nrf5340_cpunet_cis-bt_ll_sw_split.conf b/samples/bluetooth/hci_ipc/nrf5340_cpunet_cis-bt_ll_sw_split.conf index 19b78f03302..db4705c7b1e 100644 --- a/samples/bluetooth/hci_ipc/nrf5340_cpunet_cis-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_ipc/nrf5340_cpunet_cis-bt_ll_sw_split.conf @@ -5,7 +5,7 @@ CONFIG_ISR_STACK_SIZE=1024 CONFIG_IDLE_STACK_SIZE=256 CONFIG_MAIN_STACK_SIZE=512 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 -CONFIG_HEAP_MEM_POOL_SIZE=6144 +CONFIG_HEAP_MEM_POOL_SIZE=4096 CONFIG_BT=y CONFIG_BT_HCI_RAW=y diff --git a/samples/bluetooth/hci_ipc/nrf5340_cpunet_df-bt_ll_sw_split.conf b/samples/bluetooth/hci_ipc/nrf5340_cpunet_df-bt_ll_sw_split.conf index 3859fc011f8..19adc889598 100644 --- a/samples/bluetooth/hci_ipc/nrf5340_cpunet_df-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_ipc/nrf5340_cpunet_df-bt_ll_sw_split.conf @@ -5,7 +5,7 @@ CONFIG_ISR_STACK_SIZE=1024 CONFIG_IDLE_STACK_SIZE=256 CONFIG_MAIN_STACK_SIZE=512 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 -CONFIG_HEAP_MEM_POOL_SIZE=6144 +CONFIG_HEAP_MEM_POOL_SIZE=4096 CONFIG_BT=y CONFIG_BT_HCI_RAW=y diff --git a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso-bt_ll_sw_split.conf b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso-bt_ll_sw_split.conf index 5f10718be24..0ef1d134e6f 100644 --- a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso-bt_ll_sw_split.conf @@ -5,7 +5,7 @@ CONFIG_ISR_STACK_SIZE=1024 CONFIG_IDLE_STACK_SIZE=256 CONFIG_MAIN_STACK_SIZE=512 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 -CONFIG_HEAP_MEM_POOL_SIZE=6144 +CONFIG_HEAP_MEM_POOL_SIZE=4096 CONFIG_CBPRINTF_REDUCED_INTEGRAL=y CONFIG_ISR_TABLES_LOCAL_DECLARATION=y diff --git a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf index 8bcce089c6e..0fec7c0d824 100644 --- a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf @@ -5,7 +5,7 @@ CONFIG_ISR_STACK_SIZE=1024 CONFIG_IDLE_STACK_SIZE=256 CONFIG_MAIN_STACK_SIZE=512 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 -CONFIG_HEAP_MEM_POOL_SIZE=6144 +CONFIG_HEAP_MEM_POOL_SIZE=4096 CONFIG_BT=y CONFIG_BT_HCI_RAW=y diff --git a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_central-bt_ll_sw_split.conf b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_central-bt_ll_sw_split.conf index 2a450dfdf2e..58469a0309b 100644 --- a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_central-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_central-bt_ll_sw_split.conf @@ -5,7 +5,7 @@ CONFIG_ISR_STACK_SIZE=1024 CONFIG_IDLE_STACK_SIZE=256 CONFIG_MAIN_STACK_SIZE=512 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 -CONFIG_HEAP_MEM_POOL_SIZE=6144 +CONFIG_HEAP_MEM_POOL_SIZE=4096 CONFIG_BT=y CONFIG_BT_HCI_RAW=y diff --git a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf index 31eb9f6669e..1ff7ad685cf 100644 --- a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf @@ -5,7 +5,7 @@ CONFIG_ISR_STACK_SIZE=1024 CONFIG_IDLE_STACK_SIZE=256 CONFIG_MAIN_STACK_SIZE=512 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 -CONFIG_HEAP_MEM_POOL_SIZE=6144 +CONFIG_HEAP_MEM_POOL_SIZE=4096 CONFIG_BT=y CONFIG_BT_HCI_RAW=y diff --git a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf index 872da8f681b..0375097d091 100644 --- a/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf +++ b/samples/bluetooth/hci_ipc/nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf @@ -5,7 +5,7 @@ CONFIG_ISR_STACK_SIZE=1024 CONFIG_IDLE_STACK_SIZE=256 CONFIG_MAIN_STACK_SIZE=512 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 -CONFIG_HEAP_MEM_POOL_SIZE=6144 +CONFIG_HEAP_MEM_POOL_SIZE=4096 CONFIG_BT=y CONFIG_BT_HCI_RAW=y diff --git a/samples/bluetooth/hci_ipc/prj.conf b/samples/bluetooth/hci_ipc/prj.conf index 39c20b23cab..08b1aed9e7f 100644 --- a/samples/bluetooth/hci_ipc/prj.conf +++ b/samples/bluetooth/hci_ipc/prj.conf @@ -1,7 +1,7 @@ CONFIG_IPC_SERVICE=y CONFIG_MBOX=y -CONFIG_HEAP_MEM_POOL_SIZE=8192 +CONFIG_HEAP_MEM_POOL_SIZE=4096 CONFIG_MAIN_STACK_SIZE=512 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 diff --git a/tests/bluetooth/tester/nrf5340_hci_ipc_cpunet.conf b/tests/bluetooth/tester/nrf5340_hci_ipc_cpunet.conf index c224508d51a..58876f4c002 100644 --- a/tests/bluetooth/tester/nrf5340_hci_ipc_cpunet.conf +++ b/tests/bluetooth/tester/nrf5340_hci_ipc_cpunet.conf @@ -1,8 +1,5 @@ # Apply this overlay at hci_ipc controller build -# Changes towards reduced RAM usage, in order to fit the tweaks -CONFIG_HEAP_MEM_POOL_SIZE=7168 - # PTS required counts CONFIG_BT_MAX_CONN=3 diff --git a/tests/bsim/bluetooth/ll/cis/sysbuild/hci_ipc/nrf5340_cpunet_iso_acl_group-bt_ll_sw_split.conf b/tests/bsim/bluetooth/ll/cis/sysbuild/hci_ipc/nrf5340_cpunet_iso_acl_group-bt_ll_sw_split.conf index 4e63ffb6836..c43da5523ff 100644 --- a/tests/bsim/bluetooth/ll/cis/sysbuild/hci_ipc/nrf5340_cpunet_iso_acl_group-bt_ll_sw_split.conf +++ b/tests/bsim/bluetooth/ll/cis/sysbuild/hci_ipc/nrf5340_cpunet_iso_acl_group-bt_ll_sw_split.conf @@ -6,7 +6,7 @@ CONFIG_IDLE_STACK_SIZE=256 CONFIG_MAIN_STACK_SIZE=512 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512 CONFIG_IPC_SERVICE_BACKEND_RPMSG_WQ_STACK_SIZE=512 -CONFIG_HEAP_MEM_POOL_SIZE=8192 +CONFIG_HEAP_MEM_POOL_SIZE=4096 CONFIG_CBPRINTF_REDUCED_INTEGRAL=y CONFIG_BT=y