Cellular: NIDD
The NIDD sample demonstrates how to use Non-IP Data Delivery (NIDD) on an nRF91 Series device.
Requirements
The sample supports the following development kits:
Hardware platforms |
PCA |
Board name |
|
|---|---|---|---|
PCA20065 |
|
||
PCA20035 |
|
||
PCA10153 |
|
||
PCA10090 |
|
||
PCA10171 |
|
For more security, it is recommended to use the */ns variant of the board target.
When built for this variant, the sample is configured to compile and run as a non-secure application using security by separation.
Therefore, it automatically includes Trusted Firmware-M that prepares the required peripherals and secure services to be available for the application.
Overview
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).
Note
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.
Configuration
See Configuring and building 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.
Sending traces over UART on an nRF91 Series DK
To send modem traces over UART on an nRF91 Series DK, configuration must be added for the UART device in the devicetree and Kconfig. This is done by adding the modem trace UART snippet when building and programming.
Use the Cellular Monitor app for capturing and analyzing modem traces.
TF-M logging must use the same UART as the application. For more details, see shared TF-M logging.
Building and running
This sample can be found under samples/cellular/nidd in the nRF Connect SDK folder structure.
For more security, it is recommended to use the */ns variant of the board target (see the Requirements section above.)
When built for this variant, the sample is configured to compile and run as a non-secure application using security by separation.
Therefore, it automatically includes Trusted Firmware-M that prepares the required peripherals and secure services to be available for the application.
To build the sample, follow the instructions in Building an application for your preferred building environment. See also Programming an application for programming steps and Testing and optimization for general information about testing and debugging in the nRF Connect SDK.
Note
When building repository applications in the SDK repositories, building with sysbuild is enabled by default.
If you work with out-of-tree freestanding applications, you need to manually pass the --sysbuild parameter to every build command or configure west to always use it.
Testing
After programming the sample to your development kit, complete the following steps to test it:
Connect the kit to the computer using a USB cable. The kit is assigned a serial port. Serial ports are referred to as COM ports on Windows, /dev/ttyACM devices on Linux, and /dev/tty devices on macOS. To list Nordic Semiconductor devices connected to your computer together with their serial ports, open a terminal and run the
nrfutil device listcommand. Alternatively, check your operating system’s device manager or its equivalent.Connect to the kit with a terminal emulator (for example, the Serial Terminal app). See Testing and optimization for the required settings and steps.
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
Dependencies
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: