Cellular: UICC LwM2M

The UICC LwM2M sample demonstrates how to use the UICC LwM2M library on an nRF91 Series device.

Requirements

The sample supports the following development kits:

Hardware platforms

PCA

Board name

Board target

Thingy:91 X

PCA20065

thingy91x

thingy91x/nrf9151/ns

Thingy:91

PCA20035

thingy91

thingy91/nrf9160/ns

nRF9161 DK

PCA10153

nrf9161dk

nrf9161dk/nrf9161/ns

nRF9160 DK

PCA10090

nrf9160dk

nrf9160dk/nrf9160/ns

nRF9151 DK

PCA10171

nrf9151dk

nrf9151dk/nrf9151/ns

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 UICC LwM2M sample turns on UICC and tries to read the LwM2M bootstrap data record from SIM.

Note

This sample requires a SIM with LwM2M bootstrap data.

Configuration

See Configuring and building for information about how to permanently or temporarily change the configuration.

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/uicc_lwm2m 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:

  1. 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 list command. Alternatively, check your operating system’s device manager or its equivalent.

  2. Connect to the kit with a terminal emulator (for example, the Serial Terminal app). See Testing and optimization for the required settings and steps.

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

    UICC LwM2M sample started
    LwM2M bootstrap data found, length: 256
    
    0000  00 01 00 36 00 00 00 00  31 08 00 2e c8 00 25 63   ...6.... 1.....%c
    0010  6f 61 70 3a 2f 2f 6c 65  73 68 61 6e 2e 65 63 6c   oap://le shan.ecl
    0020  69 70 73 65 70 72 6f 6a  65 63 74 73 2e 69 6f 3a   ipseproj ects.io:
    0030  35 37 38 33 c1 01 01 c1  02 03 ff ff ff ff ff ff   5783.... ........
    0040  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff   ........ ........
    0050  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff   ........ ........
    0060  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff   ........ ........
    0070  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff   ........ ........
    0080  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff   ........ ........
    0090  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff   ........ ........
    00a0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff   ........ ........
    00b0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff   ........ ........
    00c0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff   ........ ........
    00d0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff   ........ ........
    00e0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff   ........ ........
    00f0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff   ........ ........
    

Dependencies

This sample uses the following sdk-nrfxlib library:

The sample also uses the following secure firmware component: