Bluetooth: NUS shell transport

The Nordic UART Service (NUS) shell transport sample demonstrates how to use the Nordic UART Service (NUS) shell transport to receive shell commands from a remote device.


When the connection is established, you can connect to the sample through the Nordic UART Service (NUS) by using a host application. You can then send shell commands that are executed on the device that runs the sample, and see the logs. See Sending shell commands for more information about the host tools that are available in nRF Connect SDK for communicating with the sample.


  • One of the following development boards:

  • A second nRF52 Development Kit board (PCA10040) for connecting with Alternatively, you can use BLE Console for connecting (Linux only).

Building and running

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

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


After programming the sample to your board, test it by connecting to it and sending some shell commands.

Perform the following steps to use the script:

  1. Connect a Nordic Development Kit (for example, PCA10040) to your PC.

  2. Start the script with the correct parameters, for example: --snr 680834186 --name BT_NUS_shell --com COM115 --family NRF52
  3. Open a terminal, for example PuTTY. Set the Connection Type to Raw and the Destination Address to

  4. Press Enter in the terminal. A console prompt is displayed.

  5. Enter the commands that you want to execute on the remote shell.

Alternatively, use the BLE Console for testing.


This sample uses the following nRF Connect SDK libraries:

In addition, it uses the following Zephyr libraries:

  • Bluetooth:

    • include/bluetooth/bluetooth.h

    • include/bluetooth/hci.h

    • include/bluetooth/uuid.h

    • include/bluetooth/gatt.h

    • samples/bluetooth/gatt/bas.h

  • Logging