nRF5 SDK for Mesh v1.0.1
Examples

The nRF5 SDK for Mesh provides several example projects to demonstrate certain features and to help you get started on new mesh-based projects.

The following examples are provided:

Example models are collected in the Example models folder, while common example utility modules are collected in Common example modules.

A simple hardware abstraction layer is shared by the examples.

How to build examples

To build the examples, follow the instructions in Building the Mesh Stack.

How to run examples

To program examples onto a Development Kit, first connect it to your computer with a USB cable. When your board is detected, you can program examples as described below.

Using Segger Embedded Studio

If you are using Segger Embedded Studio to run the examples, first erase the chip using the Target -> Erase all menu option. Then the examples can be flashed and run using the Target -> Download option, which will flash both the necessary SoftDevice and the application binary.

Using command line tools

Downloading examples using nrfjprog command line tool is a three step process. You will need to program a SoftDevice and the example hex file to your board.

The SoftDevice binaries are located in the /external/softdevice/ folder, and example binaries will be built in the corresponding example folders within the /build/ directory.

1. Program the SoftDevice

Download the SoftDevice which you chose to build mesh stack with. If you do not know the SoftDevice version that was used to build the mesh stack, check the name of the example binary.

For example, if the example's binary name is light_switch_client_nrf52832_xxAA_s132_5.0.0.hex, the required SoftDevice binary is s132_nrf52_5.0.0_softdevice.hex. To program this example run:

mesh-mbtle$ nrfjprog --program ./external/softdevice/s132_5.0.0/s132_nrf52_5.0.0_softdevice.hex --chiperase -f NRF52

2. Program example application

To program the example binary mentioned above, run:

mesh-mbtle$ nrfjprog --program ./build/examples/light_switch/client/light_switch_client_nrf52832_xxAA_s132_5.0.0.hex --sectorerase -f NRF52

3. Reset the device

To launch the example, either power cycle the device or initiate a soft-reset. Soft-reset is particularly useful if you want to setup the debugger or RTT viewer just before launching the example and prevent disconnection of the RTT link. You can initiate a soft-reset by using the following command:

mesh-mbtle$ nrfjprog -r -f NRF52

For some examples, additional steps might be required. See the Readme file for each example for more information before running it.


Documentation feedback | Developer Zone | Subscribe | Updated