nRF RPC: Protocols serialization client

The Protocols serialization client sample demonstrates how to make remote procedure calls (RPC) to a server device running the Protocols serialization server sample. The RPCs are used to control OpenThread, Bluetooth® LE, and NFC stacks running on the server device. The client and server devices use the Remote procedure call library (nRF RPC) and the nRF RPC UART transport to communicate with each other.

Requirements

The sample supports the following development kits:

Hardware platforms

PCA

Board name

Board target

nRF54LM20 DK

PCA10184

nrf54lm20dk

nrf54lm20dk/nrf54lm20b/cpuapp nrf54lm20dk/nrf54lm20a/cpuapp

nRF54L15 DK

PCA10156

nrf54l15dk

nrf54l15dk/nrf54l15/cpuapp

nRF52840 DK

PCA10056

nrf52840dk

nrf52840dk/nrf52840

To test the sample, you also need another device running the Protocols serialization server sample.

For testing the Bluetooth LE API serialization, you need the nRF Connect for Mobile app installed on your smartphone or tablet.

For testing the NFC API serialization, you need a smartphone or tablet that can read NFC tags.

Overview

The Protocols serialization client sample is a thin client that does not include OpenThread, Bluetooth LE or NFC stacks. Instead, it provides implementations of selected OpenThread, Bluetooth LE and NFC functions that forward the function calls over UART to the Protocols serialization server. The client also includes a shell for testing the serialization.

Configuration

See Configuring and building for information about how to permanently or temporarily change the configuration.

Additional configuration files

You can configure the sample using additional Kconfig fragments (.conf) and devicetree overlays (.overlay) passed to the build system.

Use EXTRA_CONF_FILE to apply extra Kconfig fragments and EXTRA_DTC_OVERLAY_FILE to apply extra devicetree overlays. When multiple files are provided, separate them with ;.

Examples:

  • Enable verbose logging and asserts:

    west build -b nrf54l15dk/nrf54l15/cpuapp -- \
      -DEXTRA_CONF_FILE=verbose.conf
    
  • Enable MPSL software coexistence (coex):

    west build -b nrf54l15dk/nrf54l15/cpuapp -- \
      -DEXTRA_CONF_FILE=coex.conf \
      -DEXTRA_DTC_OVERLAY_FILE=coex.overlay
    

Optional configuration files shipped with this sample:

  • verbose.conf - Development-oriented options: asserts and DBG log levels for this sample and nRF RPC modules.

  • log_rpc.conf - Enables the log forwarder part of the Logging RPC and log_rpc shell commands.

  • ble.conf - Enables the client part of the Bluetooth LE RPC and bt shell commands. It also enables the Nordic UART Service (NUS) and GATT Throughput Service.

  • openthread.conf - Enables the client part of the OpenThread RPC and ot shell commands.

  • nfc.conf - Enables the client part of the NFC RPC and nfc shell commands.

  • coex.conf - Enables coex shell commands for controlling the MPSL software coexistence implementation on the server device. Use together with the coex.overlay file (pass it via EXTRA_DTC_OVERLAY_FILE).

For automated testing, CI builds might add global snippets such as ci-shell and zperf together with the configuration fragments above (see the sample.yaml file).

Building and running

This sample can be found under samples/nrf_rpc/protocols_serialization/client in the nRF Connect SDK folder structure.

To build the sample, follow the instructions in Building an application for your preferred building environment. See also Programming an application for programming steps and Testing and optimization for general information about testing and debugging in the nRF Connect SDK.

Note

When building repository applications in the SDK repositories, building with sysbuild is enabled by default. If you work with out-of-tree freestanding applications, you need to manually pass the --sysbuild parameter to every build command or configure west to always use it.

Testing

To test the client sample, follow the instructions in the Testing section of the protocol serialization server sample test procedure.

Note

When using the nRF54L15 DK or nRF54LM20 DK, do not press Button 1 or Button 2. The GPIO pins connected to these buttons are used by the UART peripheral for communication with the server device.

Dependencies

This sample uses the following nRF Connect SDK libraries:

This sample uses the following sdk-nrfxlib library: