DECT NR+ RPC

This sample shows how an external MCU without a DECT NR+ modem can use a normal Zephyr DECT NR+ network interface while an nRF91 Series device runs the modem and stack over UART nRF RPC. The default boards are nRF54L15 DK (client) and nRF9151 DK (server). It uses the DECT NR+ RPC library.

Note

DECT NR+ RPC and this sample are experimental. Enable the CONFIG_DECT_NR_RPC Kconfig option and expect API and protocol changes.

Requirements

The sample supports the following development kits:

Hardware platforms

PCA

Board name

Board target

nRF9151 DK

PCA10171

nrf9151dk

nrf9151dk/nrf9151/ns

nRF54L15 DK

PCA10156

nrf54l15dk

nrf54l15dk/nrf54l15/cpuapp

You need two of the development kits (default nRF54L15 DK as RPC client and nRF9151 DK as RPC server), jumper wires for the RPC UART (see nRF54L15 DK client to nRF9151 DK server), and (for over-the-air DECT) DECT NR+ modem firmware and antennas on the server kit.

When you build for the nRF9151 DK (*/ns target), the application uses Trusted Firmware-M:

For more security, it is recommended to use the */ns variant of the board target. When built for this variant, the sample is configured to compile and run as a non-secure application using security by separation. Therefore, it automatically includes Trusted Firmware-M that prepares the required peripherals and secure services to be available for the application.

Overview

One sample tree builds the following two firmware images:

  • An RPC client on the external MCU (prj.conf).

  • An RPC server on the nRF91 Series device (server.conf).

The client exposes a tunneled dect0 net_if. The server runs the DECT NR+ modem, L2, and a local dect0 interface and mirrors the state and IPv6 to the client over UART RPC at 1 Mbps with RTS/CTS.

RPC is initialized in the main() function of the application on each side (see RPC bring-up order). Start the client before the server.

For architecture and protocol details, see DECT NR+ RPC.

Wiring

The baud rate is 1000000 (1 Mbps) with hardware flow control (RTS/CTS). Use four signals plus GND. Connect by signal (TX to RX), not by pin label alone when wiring the kits.

The default setup is nRF54L15 DK (client) to nRF9151 DK (server). An optional setup with two nRF9151 DKs uses UART1 on both (same pinmux as nRF91x1: DECT NR+ Shell Serial Modem overlay).

nRF54L15 DK client to nRF9151 DK server

Wire an nRF54L15 DK application core (RPC client) to an nRF9151 DK (RPC server).

RPC client (nRF54L15 DK)

RPC server (nRF9151 DK)

P1.08 (TX)

P0.10 (RX)

P1.09 (RX)

P0.11 (TX)

P1.11 (RTS)

P0.12 (CTS)

P1.12 (CTS)

P0.13 (RTS)

GND

GND

Two nRF9151 DKs (alternate client and server)

Optional: wire two nRF9151 DKs as RPC client and RPC server.

RPC client (nRF9151 DK)

RPC server (nRF9151 DK)

P0.11 (TX)

P0.10 (RX)

P0.10 (RX)

P0.11 (TX)

P0.13 (RTS)

P0.12 (CTS)

P0.12 (CTS)

P0.13 (RTS)

GND

GND

Use all signal rows plus GND for reliable flow control.

RPC bring-up order

RPC is initialized in the main() function of the application (no shell command). The client blocks in the nrf_rpc_init() function until the server sends the group init after modem init.

The following order is required in the bring-up:

  1. Start the client and wait for the log line that says the client is waiting for the server.

  2. Start the server. After modem initialization, it sends the group init and the client unblocks.

If the server starts first, it fails after about 15 seconds. Reset both kits and repeat with the client first.

User interface

The client exposes tunneled L2 DECT NR+ shell and RPC shell commands. The server runs the local DECT NR+ stack and modem shell on dect0.

RPC client

The client image uses the default prj.conf file (or the same options on the nRF9151 device without server.conf). It does not run the DECT NR+ modem. It mirrors the server’s DECT NR+ interface state and forwards IPv6 over RPC, so the sockets and the IP stack run locally on the external MCU.

Shell and logs use the kit serial port at 115200 8N1. RPC uses a separate UART: UART21 on the nRF54L15 DK (P1.08, P1.09, P1.11, P1.12) or UART1 on nRF9151 client (P0.10 through P0.13).

Use the following dect shell commands on the client:

  • dect rpc ping - RPC UART loopback test to the server.

  • dect sync - Pull IPv6 addresses from the server and bring tunneled dect0 up.

  • dect connect or dect disconnect - Start or stop DECT NR+ association on the server (CONFIG_DECT_NR_RPC_CONN_MGR, default enabled).

  • dect status - DECT NR+ status from the server (dedicated RPC path).

  • dect run <subcmd> [args...] - Run a DECT L2 shell command on the server (for example dect run nw_join). Use dect status instead of dect run status for status. This command does not run ICMP.

  • ping -d <destination> - ICMPv6 on dect0 (requires the ping.conf file, add dns.conf for hostnames).

Connection Manager on the client raises NET_EVENT_L4_* when the mirrored interface has a global IPv6 address. The DECT association policy (CONFIG_NET_L2_DECT_CONN_MGR_* on the server) is configured in the server.conf file only.

RPC server

The server image runs on nRF9151 DK only. Use the server.conf file with nrf9151-server-modem.overlay. The overlay reserves modem IPC shared memory on the nRF9151 DK. Flash partitions stay as in the default board overlay.

Shell and logs use the kit serial port at 115200 8N1. RPC uses UART1 on P0.10 through P0.13 (same as the nRF9151 client role).

The server runs the local DECT NR+ L2 stack and modem on dect0, with the local DECT NR+ shell (as in nRF91x1: DECT NR+ Shell). Use dect help on the server terminal for the full list.

The server does not run client-only RPC shell commands such as dect sync and does not expose a tunneled net_if. IPv6 on the air side uses server dect0. The client mirrors addresses on its own dect0.

Configuration

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

Configuration options

Check and configure the following Kconfig options:

CONFIG_SAMPLE_DECT_RPC_CLIENT_IPERF3

(bool) iPerf3 (shell command)

Enable the iperf3 shell command.

Configuration files

The sample provides predefined configuration files for typical use cases. You can find them in the sample directory.

  • prj.conf - Default RPC client (nRF54L15 or nRF9151 without modem).

  • server.conf - RPC server on the nRF9151 DK (DECT NR+ modem, conn_mgr on DECT NR+).

  • nrf9151-server-modem.overlay - Required with server.conf (modem SHMEM).

  • dns.conf and ping.conf - Optional client networking (see Building the RPC client).

  • debug-net.conf - Verbose net stack logging (client or server).

  • rpc-large-rx.conf - Larger RPC UART RX ring on the client.

  • iperf3-common.conf, iperf3-tx.conf, and iperf3-rx.conf - iperf3 on the client.

Additional configuration

Check and configure the following Kconfig options that are used by the sample:

RPC UART 1 Mbps with RTS/CTS is set in the boards/nrf54l15dk_nrf54l15_cpuapp.overlay and boards/nrf9151dk_nrf9151_ns.overlay files. See subsys/net/dect/rpc/Kconfig for tunneled packet size, event pacing, and shell options.

Building and running

This sample can be found under samples/dect/dect_rpc 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.

Note

In your nRF Connect SDK workspace, change the directory to this sample tree before you run west build, as described in Building an application. Do not pass a separate source path on the west build command line.

See Providing CMake options for instructions on how to provide CMake options, for example -DEXTRA_CONF_FILE and -DEXTRA_DTC_OVERLAY_FILE.

Building the RPC client

When you build the client on an nRF9151 DK, files under boards/ select the client devicetree (RPC UART, modem disabled in the nrf9151dk_nrf9151_ns.conf and nrf9151dk_nrf9151_ns.overlay files).

nRF54L15 DK (default)

To build and flash the RPC client on the nRF54L15 DK, use the following command:

west build -p -d build/client -b nrf54l15dk/nrf54l15/cpuapp && west flash -d build/client

nRF9151 DK (alternate client)

To build and flash the RPC client on the nRF9151 DK, use the following command:

west build -p -d build/client -b nrf9151dk/nrf9151/ns && west flash -d build/client

ICMP ping with DNS (client, optional)

The ping.conf file enables the ping shell command. Use it with the dns.conf file for hostnames.

To build and flash the client with ping and DNS on the nRF54L15 DK, use the following command:

west build -p -d build/client -b nrf54l15dk/nrf54l15/cpuapp -- -DEXTRA_CONF_FILE="ping.conf;dns.conf" && west flash -d build/client

iperf3 (client, optional)

See the iperf3 support section in nRF91x1: DECT NR+ Shell for general iperf3 usage on DECT NR+. In this sample, run iperf3 on the client dect0 after dect connect. To build and flash the client with iperf3 (TX) on the nRF54L15 DK, use the following command:

west build -p -d build/client -b nrf54l15dk/nrf54l15/cpuapp -- -DEXTRA_CONF_FILE="iperf3-common.conf;iperf3-tx.conf" && west flash -d build/client
Expected throughput (UDP over RPC)

The RPC link uses a 1 Mbps UART, but UDP throughput on client dect0 is lower than 1 Mbit/s because each datagram waits for one blocking DECT_RPC_CMD_IF_SEND RPC round-trip before the next send() can finish. With typical iperf payloads (for example -l 1220), the client throughput is on the order of half a megabit in second to a parent FT. The nRF91x1: DECT NR+ Shell sample without RPC reaches roughly twice that for the same iperf settings.

Building the RPC server

To build and flash the RPC server on the nRF9151 DK, use the following command:

west build -p -d build/server -b nrf9151dk/nrf9151/ns -- \
  -DEXTRA_CONF_FILE=server.conf \
  -DEXTRA_DTC_OVERLAY_FILE=nrf9151-server-modem.overlay && west flash -d build/server

Testing

After programming the sample to your development kit, complete the following steps to test it:

  1. Wire the kits as in Wiring.

  2. Flash the server image (Building the RPC server) on the nRF9151 DK and the client image (Building the RPC client) on the other kit.

  3. Connect both kits to the computer with USB cables.

  4. Open a serial terminal on each kit at 115200 8N1 (for example the Serial Terminal app).

  5. Reset the client first, then the server (RPC bring-up order). Both terminals should log that RPC is initialized.

  6. On the client, run dect rpc ping. Expect DECT NR+ RPC UART test: OK.

  7. Wait for auto address sync or run dect sync on the client. dect status on the client should show addresses aligned with the server.

  8. On the client, run dect connect. After association, dect status should show a connected DECT state on the server side.

  9. Optional: with the ping.conf file, run ping -d <IPv6> on the client dect0.

  10. On the server, use local dect and net commands as needed for your DECT scenario.

Troubleshooting

If the UART RPC link fails on the client or server, check the following messages and the bring-up order in RPC bring-up order.

  • nrf_rpc_uart: Ack timeout

  • RPC send failed

  • nrf_rpc_init failed: -35 or Failed to send group init packet ... err: -71 on the server

The most common cause is that the server was started before the client.

  • Check the initialization order: client waiting log first, then server until both log RPC initialized.

  • Check the wiring: TX to RX, RTS to CTS, and GND (see nRF54L15 DK client to nRF9151 DK server).

  • Check the baud rate and UART: 1 Mbps; UART21 on nRF54L15 DK client or UART1 on nRF9151.

  • For RPC UART debug, set CONFIG_NRF_RPC_TR_LOG_LEVEL_DBG and CONFIG_NRF_RPC_LOG_LEVEL_DBG to y in prj.conf or server.conf. For net stack tracing, append debug-net.conf to EXTRA_CONF_FILE on the client or use server.conf;debug-net.conf on the server.

Dependencies

This sample uses the following nRF Connect SDK libraries and subsystems:

It uses the following Zephyr library:

It uses the following modem library on the server:

In addition, it uses the following secure firmware component: