nRF5 SDK for Thread and Zigbee v4.1.0
BLE and Thread Template Example

Table of Contents

This information applies to the following SoCs: nRF52833 and nRF52840.
This example does not support the SES compiler.
This example requires the following SoftDevice: S140

Important: Before you run this example, make sure to program the SoftDevice.

Warning
There is an issue in the nRF5 SDK for Thread and Zigbee v4.1.0 that causes higher-than-usual sleep power consumption for all multiprotocol examples when using nRF52840. See workaround on DevZone.

The dynamic BLE-Thread Template example demonstrates the usage of the dynamic multiprotocol method. This example is a merge of a simplified version of BLE Peripheral Template and Thread CLI Example applications.

For more information about multiprotocol support, see Multiprotocol support with BLE/Bluetooth.

The nRF52 device operates simultaneously on Thread and BLE. It joins the Thread network as a Thread FTD device. It also acts as a BLE Peripheral device sending BLE connectable advertisements.

This example provides OpenThread’s built-in command line interface (CLI), and automatically attaches to the Thread network.


Setup

You can find the source code in the following folder: <InstallFolder>\examples\multiprotocol\ble_thread\ble_thread_dyn_template

LED assignments

The example uses LED assignments as described in Thread BSP LED and button reference for the following LEDs:

Button assignments

The following buttons reserved for user application purposes are assigned in this example:


Testing

The following testing procedure uses the nRF52840 device.

  1. Prepare at least one nRF52840 Preview Development Kit and an Android smartphone.
  2. On the smartphone, install nRF Connect for Mobile.
  3. Compile and program the SoftDevice and the application. Observe that the BSP_INDICATE_ADVERTISING state is indicated.
  4. Connect to the device from nRF Connect (the device is advertising as 'Nordic_Template'). Observe that the BSP_INDICATE_CONNECTED state is indicated.
  5. Disconnect the device in nRF Connect and observe that the BSP_INDICATE_ADVERTISING state is indicated.
  6. Connect to the board through UART. The application uses the following UART settings:
    • Baud rate: 115200
    • 8 data bits
    • 1 stop bit
    • No parity
    • HW flow control: None
    Refer to OpenThread CLI reference for complete reference of the OpenThread Command Line Interface.
  7. Run the state command to check the state of the device in the Thread network:
    > state
    leader
    Done
    The actual state may differ, depending on when the device joined the network.

Documentation feedback | Developer Zone | Subscribe | Updated