Bluetooth: Host for nRF RPC Bluetooth Low Energy

The nRF RPC Host sample demonstrates the Bluetooth® Low Energy (LE) stack with the Remote procedure call library (nRF RPC) library, which exposes the stack’s interface to another device or CPU using Remote Procedure Calls (RPC). On an nRF53 device, this sample is supposed to run on the network core and it provides the Bluetooth LE functionality for the application core.

Overview

Note

Currently, serialization of the Generic Access Profile (GAP) and Connection Management is supported.

The host (network core) is running the full Bluetooth LE stack. It receives serialized function calls that it decodes and executes, then sends response data to the client (application core).

When the sample starts, it displays the welcome prompt “Starting nRF RPC bluetooth host”.

Requirements

The sample supports the following development kits:

Hardware platforms

PCA

Board name

Build target

nRF5340 DK

PCA10095

nrf5340dk_nrf5340

nrf5340dk_nrf5340_cpunet

Building and running

You must program this sample to the nRF5340 network core.

This sample can be found under samples/bluetooth/rpc_host in the nRF Connect SDK folder structure.

See Building and programming an application for information about how to build and program the application.

Debug build

You can build the sample with a debugging configuration using the -DCONFIG_OVERLAY=overlay-debugging.conf' flag in your build.

See Providing CMake options for instructions on how to add this option to your build. For example, when building on the command line, you can do so as follows:

west build samples/bluetooth/rpc_host -- -DCONFIG_OVERLAY=overlay-debugging.conf

Example build

The recommended way of building the nRF RPC Host sample is to use the multi-image feature of the build system, building the sample with the same Bluetooth configuration as the application core sample. In this way, the sample is built automatically as a child image when CONFIG_BT_RPC is enabled.

See Configuring your application for information about how to configure a sample.

For example, building the Bluetooth: Beacon sample for the nRF5340 application core with the CONFIG_BT_RPC configuration option will include the nRF RPC Host sample in the build.

To do so on the command line, run the following command in the beacon sample directory:

west build -b nrf5340dk_nrf5340_cpuapp -- -DCONFIG_BT_RPC=y

Testing

After programming the example build to your development kit, test it by performing the following steps:

  1. Connect the dual core development kit to the computer using a USB cable. The development kit is assigned a COM port (Windows) or ttyACM device (Linux), which is visible in the Device Manager.

  2. Connect to the kit with a terminal emulator (for example, PuTTY). See How to connect with PuTTY for the required settings.

  3. Reset the development kit.

  4. Observe that the terminal connected to the network core displays “Starting nRF RPC Bluetooth host”.

  5. On the terminal connected to the application core, you can observe your Bluetooth application is running.

Dependencies

This sample uses the following nRF Connect SDK library:

It uses the following sdk-nrfxlib library: