Developing with ZBOSS for Zigbee
NCP Host user guide

The ZBOSS stack embedded inside the NCP SoC firmware as a binary HEX file implements the Zigbee PRO protocol stack. The stack includes the following stack layers:

  • Application support sub-layer (APS)
  • Zigbee device objects (ZDO)
  • Zigbee device profile (ZDP)
  • Application framework (AF)
  • Network layer (NWK)
  • Zigbee Standard Security services

The NCP SoC firmware is provided as a set of precompiled binaries for nRF52833 DK, nRF52840 DK and dongle. It can be recompiled using the NCP sample, available in nRF Connect SDK.

ZBOSS libraries for NCP host application

The ZBOSS libraries for the NCP host include the following stack layers:

  • Zigbee cluster library (ZCL)
  • Commissioning logic (part of ZDO)
  • ZBOSS NCP serialization protocol
  • ZBOSS platform support layer for Linux-based OS

Additionally, the package contains source code for all parts of the ZBOSS library for NCP host. This allows you to recompile the library for the designated hardware platform.

Hardware and software requirements

You need the following hardware and software for using the ZBOSS NCP Host package:

  • Operating system compatible with the 64-bit Ubuntu 22.04 Linux OS, which was used for building and testing the precompiled ZBOSS libraries in the package
  • nRF52833 DK (PCA10100), nRF52840 DK (PCA10056), or nRF52840 Dongle (PCA10059)

Package directory structure

The package has the following directory structure:

  • application - Application sample folder
  • include - Header files with the public ZBOSS API
  • ncp_fw - ZBOSS NCP SoC firmware files
  • lib - ZBOSS NCP Host libraries
  • src - ZBOSS sources needed for rebuilding ZBOSS libraries for NCP host application
    • aps - APS layer sources
    • common - Common ZBOSS sources
    • commissioning - ZBOSS commissioning files
    • include - Internal ZBOSS header files
    • ncp - ZBOSS NCP protocol sources
    • osif - ZBOSS platform support layer sources
    • secur - Security layer sources
    • zcl - ZCL layer sources
    • zdo - ZDO layer sources
    • Makefile - Makefile for building ZBOSS libraries
    • Makefile_zboss - Makefile for rebuilding ZBOSS libraries for NCP host
    • Options - Option file for ZBOSS libraries for NCP host
  • Makefile, Options, Platform_config - Linker scripts, options files and Makefile for the NCP host applications
  • readme.md - This guide

Building and running NCP host sample applications

Follow the instructions in this section to start using the ZBOSS NCP Host.

Programming the NCP SoC

Before running samples, you need to program the correct firmware onto the nRF52833 DK, the nRF52840 DK, or the nRF52840 Dongle.

Programming the nRF52840 DK and the nRF52833 DK

Depending on the communication channel, program one of the following firmware files onto the selected DK:

  • firmware with native UART set for communication: ncp.nrf52833dk_nrf52833.hex, ncp.nrf52840dk_nrf52840.hex
  • firmware with native USB CDC ACM class set for communication: ncp.usb.nrf52833dk_nrf52833.hex, ncp.usb.nrf52840dk_nrf52840.hex
  • For communication with the host through the native UART, connected to the debugger, run the following command::

nrfjprog –program ncp_fw/<firmware> –chiperase –reset

  • For communication through the native USB CDC ACM class, run the following command::

nrfjprog –program ncp_fw/<firmware.usb> –chiperase –reset

Programming the nRF52840 Dongle

For the dongle device, use the provided DFU package. Transfer it to the dongle using the nRF Util tool by running the following command::

nrfutil dfu usb-serial -pkg ncp_fw/ncp.usb.nrf52840dongle_nrf52840.zip -p /dev/ttyACMx

In this command, ttyACMx is the nRF USB serial bootloader device name. For the nRF Util tool documentation, see the following page: https://infocenter.nordicsemi.com/topic/ug_nrfutil/UG/nrfutil/nrfutil_intro.html

Building applications

The application folder contains a readme file with the sample description.

All NCP host samples can be rebuilt by executing the make command from the package root folder::

make

Alternatively, each sample may be rebuild individually, if the make command is executed from the sample's directory.

Running applications

For running the application, specify the NCP_SLAVE_PTY environment variable. This variable should contain the path to the correct Linux device that will be used as the communication channel.

For example, to start the light_coordinator sample on the device and communicate through the /dev/ttyACM0 port, use the following command::

NCP_SLAVE_PTY=/dev/ttyACM0 ./application/light_sample/light_coordinator/light_zc

Rebuilding the ZBOSS libraries for host

To rebuild ZBOSS libraries for NCP host in the lib directory, use the source files from the src directory::

cd src make rebuild make zbosses