nRF9160: NIDD

The NIDD sample demonstrates how to use Non-IP Data Delivery (NIDD) on an nRF9160 device.


The sample supports the following development kits:

Hardware platforms


Board name

Build target





nRF9160 DK




When built for an _ns build target, the sample is configured to compile and run as a non-secure application with Cortex-M Security Extensions enabled. Therefore, it automatically includes Trusted Firmware-M that prepares the required peripherals and secure services to be available for the application.


The NIDD sample creates a Non-IP PDN using the configured APN and uses socket operations to send and receive data. You can allocate a new PDN context to allow dual stack communication (IP and Non-IP).


This sample requires a SIM subscription with Non-IP service enabled, and LTE network configured to route the Non-IP traffic to a server that is able to respond. Before using the sample, check with your operator if Non-IP service is supported.


See Configuring your application for information about how to permanently or temporarily change the configuration.

Configuration options

Check and configure the following configuration options for the sample:

CONFIG_NIDD_APN - APN used for NIDD connection

This option specifies the APN to use for the NIDD connection.

CONFIG_NIDD_ALLOC_NEW_CID - Allocate new context identifier for NIDD connection

This option, when enabled, allocates a new PDN context identifier instead of modifying the default. This enables the use of NIDD together with regular IP traffic.

CONFIG_NIDD_PAYLOAD - Payload for NIDD transmission

This option sets the application payload to be sent as data.

Building and running

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

When built as firmware image for the _ns build target, the sample has Cortex-M Security Extensions (CMSE) enabled and separates the firmware between Non-Secure Processing Environment (NSPE) and Secure Processing Environment (SPE). Because of this, it automatically includes the Trusted Firmware-M (TF-M). To read more about CMSE, see Processing environments.

To build the sample with Visual Studio Code, follow the steps listed on the How to build an application page in the nRF Connect for VS Code extension documentation. See Building and programming an application for other building and programming scenarios and Testing and debugging an application for general information about testing and debugging in the nRF Connect SDK.


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

  1. Connect the kit to the computer using a USB cable. The kit is assigned a COM port (Windows) or ttyACM device (Linux), which is visible in the Device Manager.

  2. Connect to the kit with a terminal emulator (for example, PuTTY). See How to connect with PuTTY for the required settings.

  3. Observe that the sample starts and shows the following output from the device. Note that this is an example, and the output need not be identical to your observed output.

    NIDD sample started
    Configured Non-IP for APN "iot.nidd"
    LTE cell changed: Cell ID: 21657858, Tracking area: 40401
    RRC mode: Connected
    Network registration status: Connected - roaming
    Get PDN ID 0
    Created socket 0
    Sent 13 bytes
    Received 14 bytes: Hello, Device!
    Closed socket 0
    LTE cell changed: Cell ID: -1, Tracking area: -1
    RRC mode: Idle
    NIDD sample done


This sample uses the following nRF Connect SDK library:

It uses the following sdk-nrfxlib library:

The sample also uses the following secure firmware component: