zephyr/samples/bluetooth/hci_rpmsg
Vinayak Kariappa Chettimada 3a9e233089 samples: Bluetooth: hci_rpmsg: Fix stack sizes based on profiling
Fix stack size requirement in hci_rpmsg sample based on
profiling using thread analyzer.

Below is the observed stack usages now under Connected ISO
audio application on nrf5340_audio_dk_nrf5340_cpunet:
Thread analyze:
 0x21001968          : STACK: unused 248 usage 264 / 512 (51 %); CPU: 1 %
      : Total CPU cycles used: 102725
 HCI rpmsg TX        : STACK: unused 560 usage 592 / 1152 (51 %); CPU: 0 %
      : Total CPU cycles used: 73484
 BT RX               : STACK: unused 208 usage 432 / 640 (67 %); CPU: 2 %
      : Total CPU cycles used: 198386
 BT RX pri           : STACK: unused 200 usage 184 / 384 (47 %); CPU: 1 %
      : Total CPU cycles used: 147340
 thread_analyzer     : STACK: unused 544 usage 480 / 1024 (46 %); CPU: 1 %
      : Total CPU cycles used: 169843
 sysworkq            : STACK: unused 208 usage 304 / 512 (59 %); CPU: 0 %
      : Total CPU cycles used: 1
 idle                : STACK: unused 208 usage 48 / 256 (18 %); CPU: 91 %
      : Total CPU cycles used: 8529054
 main                : STACK: unused 144 usage 368 / 512 (71 %); CPU: 1 %
      : Total CPU cycles used: 107724
 ISR0                : STACK: unused 192 usage 832 / 1024 (81 %)

Below is the observed stack usages now under Broadcast ISO
audio application on nrf5340_audio_dk_nrf5340_cpunet:
Thread analyze:
 0x21001968          : STACK: unused 248 usage 264 / 512 (51 %); CPU: 2 %
      : Total CPU cycles used: 622241
 HCI rpmsg TX        : STACK: unused 240 usage 912 / 1152 (79 %); CPU: 2 %
      : Total CPU cycles used: 504720
 BT RX               : STACK: unused 464 usage 176 / 640 (27 %); CPU: 0 %
      : Total CPU cycles used: 3
 BT RX pri           : STACK: unused 200 usage 184 / 384 (47 %); CPU: 0 %
      : Total CPU cycles used: 212981
 thread_analyzer     : STACK: unused 544 usage 480 / 1024 (46 %); CPU: 1 %
      : Total CPU cycles used: 419593
 sysworkq            : STACK: unused 336 usage 176 / 512 (34 %); CPU: 0 %
      : Total CPU cycles used: 1
 idle                : STACK: unused 208 usage 48 / 256 (18 %); CPU: 91 %
      : Total CPU cycles used: 22065557
 main                : STACK: unused 144 usage 368 / 512 (71 %); CPU: 1 %
      : Total CPU cycles used: 388285
 ISR0                : STACK: unused 304 usage 720 / 1024 (70 %)

Relates to commit 3f7fa919d9 ("samples: Bluetooth: hci_rpmsg:
Fix RAM overflow building for DF feature").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-04-17 11:22:00 +02:00
..
dts/arm/nordic samples: Bluetooth: hci_rpmsg: Add DF, Broadcast and Connected ISO conf 2023-01-27 23:04:45 +09:00
src samples: bluetooth: hci_rpmsg: Discard too long incoming packets 2023-04-17 10:18:36 +02:00
CMakeLists.txt
debug_overlay.conf
nrf5340_cpunet_bis-bt_ll_sw_split.conf samples: Bluetooth: hci_rpmsg: Fix stack sizes based on profiling 2023-04-17 11:22:00 +02:00
nrf5340_cpunet_cis-bt_ll_sw_split.conf samples: Bluetooth: hci_rpmsg: Fix stack sizes based on profiling 2023-04-17 11:22:00 +02:00
nrf5340_cpunet_df-bt_ll_sw_split.conf samples: Bluetooth: hci_rpmsg: Fix stack sizes based on profiling 2023-04-17 11:22:00 +02:00
nrf5340_cpunet_df-bt_ll_sw_split.overlay samples: Bluetooth: hci_rpmsg: Add DF, Broadcast and Connected ISO conf 2023-01-27 23:04:45 +09:00
nrf5340_cpunet_iso_broadcast-bt_ll_sw_split.conf samples: Bluetooth: hci_rpmsg: Fix stack sizes based on profiling 2023-04-17 11:22:00 +02:00
nrf5340_cpunet_iso_central-bt_ll_sw_split.conf samples: Bluetooth: hci_rpmsg: Fix stack sizes based on profiling 2023-04-17 11:22:00 +02:00
nrf5340_cpunet_iso_peripheral-bt_ll_sw_split.conf samples: Bluetooth: hci_rpmsg: Fix stack sizes based on profiling 2023-04-17 11:22:00 +02:00
nrf5340_cpunet_iso_receive-bt_ll_sw_split.conf samples: Bluetooth: hci_rpmsg: Fix stack sizes based on profiling 2023-04-17 11:22:00 +02:00
nrf5340_cpunet_iso-bt_ll_sw_split.conf samples: Bluetooth: hci_rpmsg: Fix stack sizes based on profiling 2023-04-17 11:22:00 +02:00
prj.conf samples: Bluetooth: hci_rpmsg: Add DF, Broadcast and Connected ISO conf 2023-01-27 23:04:45 +09:00
README.rst
sample.yaml samples: Bluetooth: hci_rpmsg: Fix RAM overflow building for DF feature 2023-04-06 12:57:20 +00:00

.. _bluetooth-hci-rpmsg-sample:

Bluetooth: HCI RPMsg
####################

Overview
********

This sample exposes :ref:`bluetooth_controller` support
to another device or CPU using RPMsg transport which is
a part of `OpenAMP <https://github.com/OpenAMP/open-amp/>`__.

Requirements
************

* A board with :ref:`ipm_api` driver and Bluetooth LE support

Building and Running
********************

This sample can be found under :zephyr_file:`samples/bluetooth/hci_rpmsg`
in the Zephyr tree.

To use this application, you need a board with a Bluetooth controller
and IPM drivers.
You can then build this application and flash it onto your board in
the usual way. See :ref:`boards` for board-specific building and
programming information.

To test this sample, you need a separate device/CPU that acts as Bluetooth
HCI RPMsg peer.
This sample is compatible with the HCI RPMsg driver provided by
Zephyr's Bluetooth :ref:`bt_hci_drivers` core. See the
:kconfig:option:`CONFIG_BT_RPMSG` configuration option for more information.

You might need to adjust the Kconfig configuration of this sample to make it
compatible with the peer application. For example, :kconfig:option:`CONFIG_BT_MAX_CONN`
must be equal to the maximum number of connections supported by the peer application.

Refer to :ref:`bluetooth-samples` for general information about Bluetooth samples.