nRF Connect Docs
nRF Connect SDK Add-ons Add-ons nRF Connect SDK Bare Metal Bare Metal
Documentation sets
  • nRF Connect SDK

  • nrfxlib

  • Zephyr Project

  • MCUboot

  • Trusted Firmware-M

  • Matter

  • Kconfig Reference

★ Feedback
nRF Connect SDK
3.3.99

Contents

  • Quick Start
  • Installation
    • Installing the nRF Connect SDK
    • Updating repositories and tools
    • Requirements reference
  • Application development
    • Creating an application
    • Board support
      • nRF54LS05 DK
      • nRF54LV10 DK
    • Configuring and building
      • Build and configuration system
      • Adding files and configuring CMake
      • Configuring devicetree
        • Adding new drivers
        • Adding a dimmable LED node
        • Pin control
        • Driving a GPIO pin directly
      • Configuring Kconfig
      • Configuring sysbuild
        • Configuring sysbuild usage in west
        • Sysbuild images
        • Using Zephyr samples with sysbuild
        • Sysbuild forced options
      • Building an application
      • Output build files (image files)
    • Programming an application
    • Using companion components
    • Bootloaders and DFU
      • MCUboot and NSIB
        • Quick start guide
        • Enabling a bootloader chain using sysbuild
        • Secure bootloader chain
        • Essential MCUboot configuration items
        • Partitioning device memory
        • Image versions
        • Customizing the bootloader
        • Signature keys
        • Downgrade protection
      • Using QSPI XIP split image
      • MCUmgr Command-line tool
      • MCUboot serial recovery
      • MCUboot image compression
      • Sysbuild-assigned image IDs
      • MCUboot devicetree configuration
    • Data storage in the nRF Connect SDK
    • Working with the KMU and CRACEN
      • KMU and CRACEN hardware peripherals overview
      • PSA Crypto API programming model for KMU keys
      • Provisioning the KMU
    • Developing with nRF91 Series
      • Features of nRF91 Series
      • Configuring board controller
      • Connecting the nRF91 Series DK to nRF Cloud
      • Updating the DK firmware using Programmer
      • Configuring and building with nRF91 Series
      • Programming onto nRF91 Series devices
      • Testing the cellular connection on nRF91 Series DK
      • Snippets for an nRF91 Series device
      • Configuring external flash memory on the nRF9160 DK
    • Developing with nRF70 Series
      • Features of nRF70 Series
      • Networking stack partitioning
      • Host device considerations
      • Firmware patches in the external memory
      • Firmware patch update
      • Power profiling of nRF7002 DK
      • Developing with nRF7002 EK
      • Developing with nRF7002 EB
      • Developing with nRF7002-EB II
      • nRF70 Series advanced security modes
    • Developing with nRF54L Series
      • Enabling Zephyr Memory Storage
      • Working with the FLPR core
      • Building and programming with nRF54L SoC series
      • Signing applications with integrated FLPR payload
      • FOTA updates on nRF54L Series devices
      • Configuring DFU and MCUboot
      • MCUboot AES image encryption with ECIES-X25519 key exchange
      • nRF54L One-Time Programmable memory map for nRF Connect SDK
      • nRF54L pin mapping
      • nRF54L Errata support in nRF Connect SDK
    • Developing with nRF54H Series
      • Getting started with the nRF54H20 DK
      • nRF54H20 architecture
        • nRF54H20 domains
        • nRF54H20 memory layout
        • nRF54H20 interprocessor communication
        • nRF54H20 boot sequence
        • nRF54H20 SoC lifecycle states
        • nRF54H20 power management
        • nRF54H20 clock management
        • nRF54H20 reset behavior
        • nRF54H20 pin mapping
      • Configuring your application for a custom PCB
      • Configuring the nRF54H20 SoC
      • Configuring logging on the nRF54H20
      • Debugging on the nRF54H20
      • Working with the FLPR core
      • Working with the PPR core
      • Enabling Zephyr Memory Storage
      • IronSide Secure Enclave
        • Updating IronSide SE
        • Configuring global resources using UICR
        • Protecting a device with IronSide SE
        • Configuring secure storage
        • Using IronSide SE snapshot services
        • Managing boot flows
        • IronSide SE services
      • Provisioning keys on the nRF54H20 SoC
      • Configuring DFU and MCUboot
      • Configuring nRF54H20 applications for updates using a merged slot
      • Configuring nRF54H20 applications for updates using a manifest
      • Configuring bootloader requests on the nRF54H20 SoC
      • MCUboot AES image encryption with ECIES-X25519 key exchange
      • nRF54H20 power management optimization
      • Assigning peripherals to cores on the nRF54H20 SoC
    • Developing with nRF53 Series
      • Features of nRF53 Series
      • Building and programming with nRF53 Series
      • FOTA updates with nRF5340 DK
      • Simultaneous multi-image DFU with nRF5340 DK
      • MCUboot’s serial recovery of the networking core image
      • Getting logging output with nRF5340 DK
      • External execute in place (XIP) configuration on the nRF5340 SoC
    • Developing with nRF52 Series
      • Features of nRF52 Series
      • Building and programming on nRF52 Series devices
      • FOTA updates on nRF52 Series devices
    • Developing with Thingy:91 X
      • Features of Thingy:91 X
      • Connecting the Thingy:91x to nRF Cloud
      • Updating the Thingy:91 X firmware using nRF Util
      • Building and programming with Thingy:91 X
      • Recovering the Thingy:91 X to factory firmware
    • Developing with Thingy:91
      • Features of Thingy:91
      • Connecting to Thingy:91
      • Connecting the Thingy:91 to nRF Cloud
      • Updating the Thingy:91 firmware using nRF Connect for Desktop apps
      • Building and programming with Thingy:91
    • Developing with Thingy:53
      • Preloaded and precompiled Thingy:53 firmware
      • Building and programming with Thingy:53
      • Application guide for Thingy:53
    • Developing with PMICs
      • Developing with the nPM1300 PMIC
      • Developing with the nPM1304 PMIC
      • Developing with the nPM2100 PMIC
    • Developing with Front-End Modules
      • Enabling FEM support
        • MPSL FEM-only configuration
        • Enabling GPIO mode support for nRF21540
        • Enabling GPIO+SPI mode support for nRF21540
        • Optional FEM properties for nRF21540 GPIO and GPIO+SPI
        • Enabling support for front-end modules using Simple GPIO interface
        • Use case of incomplete physical connections to the FEM module
      • Using FEM power models
      • Developing with the nRF21540 EK
    • Developing with custom boards
      • Defining custom board
      • Connecting custom boards for programming
    • Coexistence of short-range radio and other radios
    • Developing with coprocessors
      • Introduction to Soft Peripherals and High-Performance Framework
      • High-Performance Framework (HPF)
        • Assembly management
        • Event handling
        • Fault handling
        • Power management
        • Real-time peripherals
  • Testing and optimization
    • Debugging an application
    • Logging in nRF Connect SDK
    • Test framework
      • Writing tests with Unity and CMock
      • Running unit tests
    • Optimizing application
      • Memory footprint optimization
      • Power optimization
        • Power optimization recommendations
        • Power optimization with Online Power Profiler
  • Security
    • PSA Certified Security Framework overview
    • Cryptography in the nRF Connect SDK
      • Cryptographic architecture overview
      • Cryptographic drivers
      • Configuring PSA Crypto API
      • Supported cryptographic operations in the nRF Connect SDK
    • Trusted Firmware-M in the nRF Connect SDK
      • TF-M support and limitations in the nRF Connect SDK
      • Trusted Firmware-M architecture
      • Security by separation and processing environments
      • Building and configuring TF-M
      • TF-M Services
      • TF-M provisioning
      • TF-M logging
    • Managing access port protection
    • Secure storage in the nRF Connect SDK
    • Key storage in the nRF Connect SDK
  • Protocols
    • Aliro
    • Amazon Sidewalk
    • Bluetooth
      • Bluetooth solution areas
      • Bluetooth stack architecture
      • Bluetooth Mesh
        • Bluetooth Mesh overview
        • Configuring Bluetooth Mesh in nRF Connect SDK
        • Configuring Bluetooth Mesh models using the nRF Mesh mobile app
        • Device Firmware Updates (DFU) in Bluetooth Mesh
        • Removing a node from a Bluetooth Mesh network
        • Creating a new Bluetooth Mesh model
        • Running Bluetooth Mesh samples on other platforms
      • Bluetooth qualification
    • Cellular
      • Cellular overview
      • Getting started with cellular products
      • Power saving techniques
      • Power profiling cellular applications
    • DECT NR+
    • Enhanced ShockBurst (ESB)
    • Gazell
      • Gazell Link Layer
      • Gazell Pairing
    • Matter
      • Matter overview
        • Matter architecture
        • Matter Data Model and device types
        • Matter Interaction Model and interaction types
        • Matter network topology and concepts
        • Matter network security
        • Matter network commissioning
        • Matter multiple fabrics feature
        • Matter Group Communication
        • Matter OTA
        • Matter Bridge
        • Matter development model and compatible ecosystems
        • Matter integration in the nRF Connect SDK
      • Getting started with Matter
        • Matter hardware and memory requirements
        • Testing Matter in the nRF Connect SDK
        • Matter tools
        • Enabling Matter in Kconfig
        • Advanced Matter Kconfig options
        • Configuring transmission power
        • Creating manufacturer-specific clusters in Matter application
        • Adding clusters to Matter application
        • Matter APIs
        • Adding Bluetooth LE services to Matter application
        • Reducing power consumption in Matter
        • Optimizing memory usage in Matter applications
        • Testing with commercial Matter ecosystems
      • How to create Matter end product
        • Matter device development prerequisites
        • Matter Compliant Platform and Derived Matter Product (DMP)
        • Factory provisioning in Matter
        • Matter Device Attestation
        • Matter Distributed Compliance Ledger
        • Matter certification
        • Ecosystems certification
        • Bootloader configuration in Matter
        • Security
        • Storing Certification Declaration in firmware
        • Maintaining firmware version
        • Matter fabric removal
        • Matter test event triggers
        • Matter watchdog
    • Multiprotocol support
    • Near Field Communication (NFC)
    • Thread
      • OpenThread overview
        • Supported Thread features
        • OpenThread architectures
        • OpenThread co-processor communication
        • OpenThread integration
        • OpenThread memory requirements
        • OpenThread power consumption
        • OpenThread commissioning
        • OpenThread security
      • Configuring Thread in the nRF Connect SDK
      • Pre-built libraries
      • Thread tools
      • Thread certification
      • Thread device types
      • Sleepy End Device types in Thread
      • Thread Commissioning Over Authenticated TLS
    • Wi-Fi
      • Wi-Fi overview
      • Wi-Fi certification
      • Station mode
        • Memory requirements for Wi-Fi applications in Station mode
        • Operating in power save modes
      • Scan mode
        • Memory requirements for Wi-Fi applications in Scan mode
        • Optimizing scan operation
      • SoftAP mode
        • Memory requirements for Wi-Fi applications in SoftAP mode
        • SoftAP mode
      • Wi-Fi Direct (P2P mode)
      • Advanced modes
        • Memory requirements for Wi-Fi applications in Raw mode
        • Raw IEEE 802.11 packet transmission
        • Raw IEEE 802.11 packet reception using Monitor mode
        • Raw IEEE 802.11 packet reception using Promiscuous mode
        • Offloaded raw transmit operation
      • Wi-Fi provisioning
        • Memory requirements for Bluetooth LE based provisioning
        • Memory requirements for SoftAP based provisioning
      • Operating with regulatory support
      • Debugging
      • Wi-Fi stack configuration and performance
      • Regulatory Certification Testing for nRF70 Series Devices
        • Test setup
        • Regulatory test cases
        • Antenna gain compensation
        • Band edge compensation
        • Using the Wi-Fi Radio test sample
        • Using the Radio test (short-range) sample
        • Using the Wi-Fi Shell sample
        • Using the Wi-Fi Station sample
        • EN 301 893 V2.1.1 based adaptivity test procedure
    • Wireless coexistence
    • Zigbee
  • Applications
    • Asset Tracker Template
    • Serial Modem
    • Connectivity bridge
    • IPC radio firmware
    • Matter bridge
      • Application guide
        • Matter bridge application configuration options
      • Extending the application
        • Adding support for a new Matter device type
        • Adding support for a new Bluetooth LE service
        • Adding support for a proprietary protocol
    • nRF Audio applications
      • nRF Audio overview and firmware architecture
      • nRF Audio feature support and QDIDs
      • nRF Audio application requirements
      • User interface
      • Configuring the nRF Audio applications
      • Building and running nRF Audio applications
      • nRF Audio: Broadcast sink
      • nRF Audio: Broadcast source
      • nRF Audio: Unicast client
      • nRF Audio: Unicast server
      • Adapting nRF Audio applications for end products
      • nRF Audio: Application-specific Kconfig options
      • Audio applications: API documentation
    • nRF Desktop
      • nRF Desktop: Application description
      • nRF Desktop: Application-specific Kconfig options
      • nRF Desktop: Board configuration
      • nRF Desktop: Adding nRF21540 EK shield support
      • nRF Desktop: Memory layout
      • nRF Desktop: Bluetooth
      • nRF Desktop: Bootloader and Device Firmware Update
      • nRF Desktop: fwupd support
      • nRF Desktop: Integrating your own hardware
      • nRF Desktop: Application internal modules
        • Basic module (main)
        • Battery charger module
        • Battery measurement module
        • Bluetooth LE advertising module
        • Bluetooth LE advertising control module
        • Bluetooth LE bond module
        • Bluetooth LE connection parameters module
        • Bluetooth LE discovery module
        • Bluetooth LE latency module
        • Bluetooth LE passkey module
        • Bluetooth LE Quality of Service module
        • Bluetooth LE scanning module
        • Bluetooth state power manager module
        • Bluetooth LE state module
        • Board module
        • Buttons module
        • Button simulator module
        • Click detector module
        • CPU measurement module
        • Device description module
        • Device Firmware Upgrade module
        • Device Firmware Upgrade MCUmgr module
        • DVFS module
        • Factory reset module
        • Failsafe module
        • Fast Pair module
        • Function key module
        • GATT Battery Service module
        • HID forward module
        • HID provider consumer control module
        • HID provider keyboard module
        • HID provider mouse module
        • HID provider system control module
        • HID state module
        • HID state power manager module
        • HID Service module
        • Info module
        • LED state module
        • LED stream module
        • LEDs module
        • Motion module
        • Passkey module
        • Power manager module
        • nRF Profiler synchronization module
        • Quality of Service module
        • Selector module
        • Simple Management Protocol module
        • Settings loader module
        • Swift Pair module
        • USB state power manager module
        • USB state module
        • Watchdog module
        • Wheel module
        • Constant latency hotfix module
        • High frequency clock lock hotfix module
        • Source and sink module lists
      • nRF Desktop: Application internal utilities
        • Configuration channel
        • DFU lock utility
        • HID event queue utility
        • HID keymap utility
        • HID report queue utility
        • Keys state utility
      • nRF Desktop: Application Kconfig options scheme
      • nRF Desktop: API documentation
    • High-Performance Framework
      • High-Performance Framework GPIO
      • High-Performance Framework MSPI
    • Matter weather station
    • Installer (MCUboot Firmware Loader installer)
  • Samples
    • Amazon Sidewalk samples
    • Bluetooth Fast Pair samples
      • Bluetooth Fast Pair: Input device
      • Bluetooth Fast Pair: Locator tag
    • Bluetooth Mesh samples
      • Bluetooth Mesh: Coexistence with other LE services
      • Bluetooth Mesh: Chat
        • Sample description
        • Chat Client model
      • Bluetooth Mesh: Light
      • Bluetooth Mesh NLC: Lightness Controller/Energy Monitor
      • Bluetooth Mesh NLC: Dimming Control/Scene Selector
      • Bluetooth Mesh: Light switch
      • Bluetooth Mesh NLC: HVAC Integration (Sensor observer)
      • Bluetooth Mesh NLC: Ambient Light Sensor/Occupancy Sensor
      • Bluetooth Mesh: Silvair EnOcean
      • Bluetooth Mesh: Device Firmware Update (DFU) distributor
      • Bluetooth Mesh: Device Firmware Update (DFU) target
    • Bluetooth samples
      • Bluetooth: Central and Peripheral HRS
      • Bluetooth: Central BAS
      • Bluetooth: Central HIDS
      • Bluetooth: Central Heart Rate Monitor with Coded PHY
      • Bluetooth: Central NFC pairing
      • Bluetooth: Central SMP Client
      • Bluetooth: Central UART
      • Bluetooth: Connection time synchronization
      • Bluetooth: Direct Test Mode
      • Bluetooth: Direction finding central
      • Bluetooth: Direction finding connectionless locator
      • Bluetooth: Direction finding connectionless beacon
      • Bluetooth: Direction finding peripheral
      • Bluetooth: EnOcean
      • Bluetooth: Event Trigger
      • Bluetooth: HCI low power UART
      • Bluetooth: ISO combined BIS and CIS
      • Bluetooth: ISO time synchronization
      • Bluetooth: LLPM
      • Bluetooth: Multiple advertising sets
      • nRF Auraconfig
      • Bluetooth: nRF Distance Measurement with Bluetooth LE discovery
      • Bluetooth: Path loss monitoring
      • Bluetooth: Peripheral AMS client
      • Bluetooth: Peripheral ANCS client
      • Bluetooth: Peripheral Bond Management Service (BMS)
      • Bluetooth: Continuous Glucose Monitoring Service (CGMS)
      • Bluetooth: Peripheral CTS client
      • Bluetooth: Peripheral GATT Discovery Manager
      • Bluetooth: Peripheral HIDS keyboard
      • Bluetooth: Peripheral HIDS mouse
      • Bluetooth: Peripheral Heart Rate Monitor with Coded PHY
      • Bluetooth: Peripheral LBS
      • Bluetooth: Peripheral Memfault Diagnostic Service (MDS)
      • Bluetooth: NFC pairing
      • Bluetooth: Peripheral power profiling
      • Bluetooth: Peripheral Running Speed and Cadence Service (RSCS)
      • Bluetooth: Peripheral Status
      • Bluetooth: Peripheral UART
      • Bluetooth: Peripheral with multiple identities
      • Bluetooth: External radio coexistence using 1-wire interface
      • Bluetooth: Radio Notification callback
      • Bluetooth: Host for nRF RPC Bluetooth Low Energy
      • Bluetooth: Automated power control
      • Bluetooth: Scanning while connecting
      • Bluetooth: NUS shell transport
      • Bluetooth: Shorter Connection Intervals
      • Bluetooth: Connection Subrating
      • Bluetooth: Throughput
      • Bluetooth: Channel Sounding Initiator with Inline PCT Transfer
      • Bluetooth: Channel Sounding Reflector with Inline PCT Transfer
      • Bluetooth: Channel Sounding Initiator with Ranging Requestor
      • Bluetooth: Channel Sounding Reflector with Ranging Responder
      • nRF Auraconfig test
      • nRF Auraconfig tester test
      • Bluetooth: Bluetooth LE master test app
    • Cellular samples
      • Cellular: AT Client
      • Cellular: AT monitor
      • Cellular: Battery
      • Cellular: Full modem firmware update using SMP Server
      • Cellular: GNSS
      • Cellular: Location
      • Cellular: LwM2M carrier
        • Sample description
        • Preparing for production
      • Cellular: LwM2M Client
        • Sample description
        • Evaluating LwM2M Advanced Firmware Update
        • Evaluating LwM2M Advanced Firmware Update for external MCU
        • Preparing for production
      • Cellular: Modem callbacks
      • Cellular: Modem Shell
      • Cellular: Modem trace backend
      • Cellular: Modem trace external flash backend
      • Cellular: NIDD
      • Cellular: nRF Cloud CoAP cellular location
      • Cellular: nRF Cloud CoAP device message
      • Cellular: nRF Cloud CoAP FOTA
      • Cellular: nRF Cloud MQTT cellular location
      • Cellular: nRF Cloud MQTT device message
      • Cellular: nRF Cloud MQTT FOTA
      • Cellular: nRF Device provisioning
      • Cellular: PDN
      • Cellular: SMP Server
      • Cellular: SMS
      • Cellular: TLS cipher suites
      • Cellular: UDP
      • Cellular: UICC LwM2M
      • Cellular: HTTP application update
      • Cellular: HTTP modem delta update
      • Cellular: HTTP full modem update
    • Cryptographic samples
      • Crypto: AES CBC
      • Crypto: AES CCM
      • Crypto: AES CTR
      • Crypto: AES GCM
      • Crypto: AES KW
      • Crypto: Chacha20-Poly1305 example
      • Crypto: ECDH
      • Crypto: ECDSA
      • Crypto: EC J-PAKE
      • Crypto: EdDSA
      • Crypto: HKDF
      • Crypto: HMAC
      • Crypto: KMU usage with CRACEN
      • Crypto: PBKDF2
      • Crypto: Persistent key usage
      • Crypto: PSA TLS
      • Crypto: RNG
      • Crypto: RSA
      • Crypto: SHA-256
      • Crypto: Spake2+
    • IronSide Secure Enclave samples
      • Protected Memory with PERIPHCONF Partition
      • Secondary boot
      • Secondary boot with APPLICATIONLOCKUP trigger
    • Debug samples
      • Memfault
      • PPI trace
    • DECT NR+ samples
      • nRF91x1: DECT NR+ Shell
      • nRF91x1: Hello DECT
      • nRF91x1: DECT NR+ PHY Shell
      • nRF91x1: DECT NR+ PHY hello
    • DFU samples
      • MCUboot SMP Server
      • A/B with MCUboot
      • A/B with MCUboot and separated slots
      • DFU Multi-image
      • DFU Target
      • Single-slot DFU with MCUboot
      • Minimal Bluetooth LE SMP firmware loader
      • Minimal USB virtual serial port SMP firmware loader
      • Firmware loader entrance
      • MCUboot with encryption enabled
      • MCUboot minimal configuration
      • MCUboot with decompression enabled
      • nRF Secure Immutable Bootloader
    • Enhanced ShockBurst samples
      • Enhanced ShockBurst: Monitor
      • Enhanced ShockBurst: Receiver
      • Enhanced ShockBurst: Receiver with Bluetooth LE
      • Enhanced ShockBurst: Transmitter
      • Enhanced ShockBurst: Transmitter with Bluetooth LE
    • Gazell samples
      • Gazell ACK Payload Device
      • Gazell ACK Payload Host
      • Gazell Dynamic Pairing Device
      • Gazell Dynamic Pairing Host
    • Keys samples
      • Hardware unique key
      • Identity key generation
      • Identity key usage
    • Matter samples
      • Matter: Closure
      • Matter: Contact sensor
      • Matter: Light bulb
      • Matter: Light switch
      • Matter: Door lock
      • Matter: Manufacturer-specific
      • Matter: Smoke CO Alarm
      • Matter: Temperature Sensor
      • Matter: Template
      • Matter: Thermostat
      • Matter: Window covering
      • Shared configurations in Matter samples
      • Shared configurations in Matter stack
      • Matter Sample Checker
      • Matter snippet collection
        • Matter debug snippet (matter-debug)
        • Matter diagnostic logs snippet (matter-diagnostic-logs)
    • Networking samples
      • AWS IoT
      • Azure IoT Hub
      • CoAP Client
      • Download
      • HTTP Server
      • HTTPS Client
      • MQTT
        • Sample description
        • Architecture
        • Provisioning
      • UDP
    • NFC samples
      • NFC: Launch App
      • NFC: Text record
      • NFC: Shell
      • NFC: System OFF
      • NFC: Tag reader
      • NFC: TNEP poller
      • NFC: TNEP tag
      • NFC: Writable NDEF message
    • nRF5340 samples
      • nRF5340: Empty firmware for application core
      • nRF5340: SMP Server with external XIP
      • nRF5340: Network core bootloader
      • nRF5340: Remote IPC shell
      • nRF5340: nRF RPC Entropy
    • Peripheral samples
      • IEEE 802.15.4 PHY test tool
      • IEEE 802.15.4 Sniffer
      • Low Power UART
      • PPI Sequencer with SPI
      • Radio test (short-range)
    • PMIC samples
      • nPM1300 and nPM1304: Fuel gauge
      • nPM1300 and nPM1304: One button
      • nPM2100: Fuel gauge
      • nPM2100: One button
    • Protocol serialization samples
      • nRF RPC: Protocols serialization client
      • nRF RPC: Protocols serialization server
    • Sensor samples
      • BH1749: Ambient Light Sensor IC
      • BME68X: Gas Sensor
    • Thread samples
      • Thread: CLI
      • Thread: CoAP Client
      • Thread: CoAP Server
      • Thread: Co-processor
      • OpenThread snippet collection
        • OpenThread snippet for CI purpose (ot-ci)
        • OpenThread snippet for debugging purpose (ot-debug)
        • OpenThread snippet for diagnostic GPIO commands (ot-diag-gpio)
        • OpenThread snippet for logging (ot-logging)
        • OpenThread snippet for USB transport (ot-usb)
        • OpenThread snippet for Zephyr L2 networking layer (ot-zephyr-l2)
    • Trusted Firmware-M (TF-M) samples
      • TF-M: Provisioning image
      • TF-M: Provisioning image for network core
      • TF-M Hello World
      • TF-M: PSA template
      • TF-M secure peripheral partition
      • TF-M: Platform security architecture test
    • Wi-Fi samples
      • Wi-Fi: Bluetooth LE coexistence
      • Wi-Fi: Monitor
      • Wi-Fi: nRF Cloud
      • Wi-Fi: Offloaded raw TX
      • Wi-Fi: P2P
      • Wi-Fi: Promiscuous
      • Wi-Fi: Raw TX packet
      • Wi-Fi: Scan
      • Wi-Fi: Shell
      • Wi-Fi: Shutdown
      • Wi-Fi: SoftAP
      • Wi-Fi: Station
      • Wi-Fi: Thread coexistence
      • Wi-Fi: Throughput
      • Wi-Fi: TWT
      • Wi-Fi: WFA QuickTrack control application
      • Wi-Fi: Radio test samples
        • Wi-Fi: Radio test (Multi domain)
        • Wi-Fi: Bluetooth LE Wi-Fi Radio test (Single domain)
      • Wi-Fi: Provisioning samples
        • Wi-Fi: Bluetooth LE based provision
        • Wi-Fi: Provisioning Internal
        • Wi-Fi: SoftAP based provision
      • Wi-Fi: Zephyr networking samples
    • Zigbee samples
    • Other samples
      • Application Event Manager
      • Application Event Manager profiling tracer
      • Application JWT
      • Common Application Framework preview
      • CAF: Sensor manager
      • Event Manager Proxy
      • Hardware ID
      • nRF Profiler
      • IPC service
      • MPSL timeslot
      • CoreMark
      • Protected Memory with PERIPHCONF Partition
      • Secondary boot
      • Secondary boot with APPLICATIONLOCKUP trigger
      • Multicore idle test
      • Multicore idle GPIO test
      • PWM in low power states test
      • Empty firmware for multiple core SoCs
      • Multicore idle test with firmware relocated to radio core TCM
  • Drivers
    • BH1749 driver
    • BME68X IAQ driver
    • CC3XX entropy driver
    • Ethernet over RTT driver
    • CC3XX hardware driver
    • sQSPI MSPI shim driver
    • PAW3212 driver
    • PMW3360 driver
    • PPI Sequencer
    • PPI Sequencer for I2C/SPI
    • Simulated sensor driver
    • Sensor stub driver
    • UART driver
    • IPC UART driver
    • Low power UART driver
    • Wi-Fi drivers
      • nRF Wi-Fi driver
      • nRF Wi-Fi portable driver
      • Low-level API
  • Libraries
    • Binary libraries
      • LwM2M carrier
        • Certification and version dependencies
        • Application integration
        • Requirements and application limitations
        • Message sequence charts
        • API documentation
        • Changelog
    • Bluetooth libraries and services
      • Google Fast Pair libraries
        • Google Fast Pair Service (GFPS)
        • Fast Pair Advertising Manager
      • Bluetooth LE advertising providers
      • Bluetooth connection context
      • Bluetooth Channel Sounding Distance Estimation
      • DTM 2-wire UART to HCI Converter
      • Bluetooth EnOcean
      • GATT Discovery Manager
      • Bluetooth GATT attribute pools
      • Bluetooth Mesh libraries
        • Bluetooth Mesh models
        • Bluetooth Mesh properties
        • Bluetooth Mesh provisioning handler for Nordic DKs
        • Bluetooth Mesh sensors
        • Bluetooth Mesh sensor formats and sensor types
      • Radio Notification callback
      • Bluetooth Low Energy Remote Procedure Call
      • Bluetooth LE scanning
      • Apple Media Service (AMS) Client
      • Apple Notification Center Service (ANCS) Client
      • GATT Battery Service (BAS) Client
      • GATT Bond Management Service (BMS)
      • GATT Continuous Glucose Monitoring Service (CGMS)
      • GATT Current Time Service (CTS) Client
      • Direction and Distance Finding Service (DDFS)
      • GATT DFU SMP Service Client
      • Generic Attribute (GATT) Profile
      • GATT Human Interface Device (HID) Service
      • GATT Human Interface Device Service (HIDS) Client
      • GATT Heart Rate Service (HRS) Client
      • GATT Latency Service
      • GATT Latency Client
      • LED Button Service (LBS)
      • Memfault Diagnostic Service (MDS)
      • Nordic Status Message Service (NSMS)
      • Nordic UART Service (NUS)
      • Nordic UART Service (NUS) Client
      • Ranging Requestor (RREQ)
      • Ranging Responder (RRSP)
      • Running Speed and Cadence Service (RSCS)
      • GATT Throughput Service
      • Wi-Fi provisioning Bluetooth LE transport
    • Common Application Framework
      • Common Application Framework overview
      • CAF: Bluetooth LE advertising module
      • CAF: Bluetooth LE bond module
      • CAF: Simple Management Protocol module
      • CAF: Bluetooth LE state module
      • CAF: Bluetooth state power manager module
      • CAF: Buttons module
      • CAF: Power manager keep alive module for buttons
      • CAF: Shell module
      • CAF: Click detector module
      • CAF: LEDs module
      • CAF: Network state module
      • CAF: Power manager module
      • CAF: Sensor data aggregator module
      • CAF: Sensor manager module
      • CAF: Settings loader module
    • Debug libraries
      • CPU load measurement
      • ETB trace
      • Memfault
      • PPI trace
    • DFU libraries
      • DFU extra image extensions
      • DFU multi-image
      • DFU target
      • Full modem firmware update from flash device
      • Mcumgr-based full modem update
      • Peripheral CPU DFU (PCD)
    • Gazell libraries
      • Gazell Link Layer glue
      • Gazell Pairing
    • Modem libraries
      • Modem library integration layer
        • Library wrapper
        • Socket offloading
        • OS abstraction layer
        • Devicetree integration
        • Partition manager integration
        • Network interface driver
        • Modem trace module
        • Modem fault handling
        • Diagnostic functionality
        • API documentation
      • Custom AT commands
      • AT Host
      • AT monitor
      • AT parser
      • AT shell
      • GCF SMS
      • Location
      • LTE link control
      • Modem antenna
      • Modem attestation token
      • Modem battery
      • Modem information
      • Modem JWT
      • Modem key management
      • NTN
      • SMS
      • UICC LwM2M
      • China Telecom ZZHC library
    • Multiprotocol Service Layer libraries
      • Multiprotocol Service Layer assert
      • Multiprotocol Service Layer library control
      • Multiprotocol Service Layer workqueue
    • Libraries for networking
      • AWS FOTA
      • AWS IoT
      • AWS jobs
      • Azure FOTA
      • Azure IoT Hub
      • CoAP utils
      • Downloader
      • FOTA download
      • iCalendar parser
      • LwM2M client utils
      • LwM2M location assistance
      • MQTT helper
      • nRF 802.15.4 callbacks dispatcher
      • nRF Cloud
      • nRF Cloud A-GNSS
      • nRF Cloud CoAP
      • nRF Cloud location
      • nRF Cloud P-GPS
      • nRF Cloud device provisioning
      • OpenThread Remote Procedure Call
      • REST client
      • SoftAP Wi-Fi provision
      • Wi-Fi management extension
      • Wi-Fi Provisioning Core
      • Wi-Fi Provisioning Configuration Generator
      • Wi-Fi ready
    • Libraries for NFC
      • NFC Data Exchange Format (NDEF)
        • Connection Handover messages and records
        • Parser for Connection Handover records
        • Launch App
        • Bluetooth LE OOB records
        • Parser for Bluetooth LE OOB records
        • Messages and records
        • Parser for messages and records
        • Text records
        • URI messages and records
      • NFC Remote Procedure Call
      • Type 2 Tag
        • Type 2 Tag parser
      • Type 4 Tag
        • APDU reader and writer
        • Parser for CC files
        • Type 4 Tag procedures
        • ISO-DEP protocol
        • NDEF file
      • Tag NDEF Exchange Protocol (TNEP)
        • NFC TNEP Connection Handover
        • TNEP for polling device
        • TNEP for tag device
    • nRF RPC libraries
      • nRF RPC IPC Service transport
      • nRF RPC UART transport
      • nRF RPC utility commands
    • Other libraries
      • Accel to angle
      • adp536x
      • Application Event Manager
      • Application Event Manager profiler tracer
      • Application JWT
      • Audio module
      • Continuous array
      • Data FIFO
      • Date-Time
      • DK Buttons and LEDs
      • Distance Measurement
      • Detecting Unwanted Location Trackers (DULT)
      • Emergency data storage
      • Enhanced ShockBurst
      • Event Manager Proxy
      • FEM abstraction layer
      • Partition Manager flash map
      • Hardware ID
      • Logging Remote Procedure Call
      • Network core monitor
      • nRF Compression
      • nRF Life Cycle State
      • nRF Profiler
      • Pulse Code Modulation audio mixer
      • PCM Stream Channel Modifier
      • Quality of Service
      • RAM power-down
      • Short float (SFLOAT)
      • NFC Reader ST25R3911B
      • SUPL client and SUPL client OS integration
      • Tone generator
      • UART async adapter
      • Wave generator
    • Security libraries
      • Bootloader libraries
        • Bootloader crypto
        • Bootloader storage
        • Bootloader firmware validation
        • Flash patch
        • Hardware flash write protection
        • Firmware information
      • nRF Security
        • Enabling nRF Security
        • Configuring nRF Security with legacy crypto APIs
      • TF-M libraries
        • TF-M input/output control (IOCTL)
      • Fatal error handler
      • Hardware unique key
      • Identity key
      • Trusted storage
    • Shell libraries
      • Nordic UART Service (NUS) shell transport
      • IPC service shell transport
      • NFC shell transport
  • Scripts
    • nRF Connect SDK toolchain Docker image
    • Enhanced ShockBurst Sniffer
    • PSA Key Attributes generator script
    • HID configurator for nRF Desktop
    • MDS BLE gateway script
    • nRF Profiler host tools
    • Fast Pair provision script
    • Partition Manager
    • Bluetooth LE NUS shell script
    • Bluetooth LE Console
    • Software Bill of Materials
  • Integrations
    • Google Fast Pair integration
      • Integration overview
      • Google Fast Pair Advertising Manager integration
    • nRF Cloud powered by Memfault integration
    • AVSystem integration
    • Using nRF Cloud with the nRF Connect SDK
    • CoreMark integration
    • Detecting Unwanted Location Trackers (DULT) integration
  • Development model and contributions
    • nRF Connect SDK code base
    • Managing the code base
    • Adding your own code
    • Redistributing the nRF Connect SDK
    • Licenses
    • Contribution guidelines in the nRF Connect SDK
    • nRF Connect SDK documentation
      • Documentation structure
      • Documentation build process
      • Building the nRF Connect SDK documentation
      • Documentation guidelines
      • Documentation templates
        • Template: Integration
        • Template: Application
        • Custom service template
        • Template: Library
        • Mesh model template
        • Template: Sample
  • Releases and maturity
    • Release notes
      • Changelog for nRF Connect SDK v3.3.99
      • nRF Connect SDK v3.3.1 Release Notes
      • nRF Connect SDK v3.3.0 Release Notes
      • Changelog for nRF Connect SDK v3.3.0-preview3
      • Changelog for nRF Connect SDK v3.3.0-preview2
      • Changelog for nRF Connect SDK v3.3.0-preview1
      • nRF Connect SDK v3.2.4 Release Notes
      • nRF Connect SDK v3.2.3 Release Notes
      • nRF Connect SDK v3.2.2 Release Notes
      • nRF Connect SDK v3.2.1 Release Notes
      • nRF Connect SDK v3.2.0 Release Notes
      • Changelog for nRF Connect SDK v3.2.0-preview3
      • Changelog for nRF Connect SDK v3.2.0-preview2
      • Changelog for nRF Connect SDK v3.2.0-preview1
      • nRF Connect SDK v3.1.1 Release Notes
      • nRF Connect SDK v3.1.0 Release Notes
      • Changelog for nRF Connect SDK v3.1.0-preview3
      • Changelog for nRF Connect SDK v3.1.0-preview2
      • Changelog for nRF Connect SDK v3.1.0-preview1
      • nRF Connect SDK v3.0.2 Release Notes
      • nRF Connect SDK v3.0.1 Release Notes
      • nRF Connect SDK v3.0.0 Release Notes
      • Changelog for nRF Connect SDK v3.0.0-preview2
      • Changelog for nRF Connect SDK v3.0.0-preview1
      • nRF Connect SDK v2.9.3 Release Notes
      • nRF Connect SDK v2.9.2 Release Notes
      • nRF Connect SDK v2.9.1 Release Notes
      • nRF Connect SDK v2.9.0-nRF54H20-1 Release Notes
      • nRF Connect SDK v2.9.0 Release Notes
      • nRF Connect SDK v2.8.0 Release Notes
      • Changelog for nRF Connect SDK v2.8.0-preview1
      • nRF Connect SDK v2.7.99-cs2 Release Notes
      • nRF Connect SDK v2.7.99-cs1 Release Notes
      • nRF Connect SDK v2.7.0 Release Notes
      • nRF Connect SDK v2.6.99-cs2 Release Notes
      • nRF Connect SDK v2.6.99-cs1 Release Notes
      • nRF Connect SDK v2.6.6 Release Notes
      • nRF Connect SDK v2.6.5 Release Notes
      • nRF Connect SDK v2.6.4 Release Notes
      • nRF Connect SDK v2.6.3 Release Notes
      • nRF Connect SDK v2.6.2 Release Notes
      • nRF Connect SDK v2.6.1 Release Notes
      • nRF Connect SDK v2.6.0 Release Notes
      • nRF Connect SDK v2.5.3 Release Notes
      • nRF Connect SDK v2.5.2 Release Notes
      • nRF Connect SDK v2.5.1 Release Notes
      • nRF Connect SDK v2.5.0 Release Notes
      • nRF Connect SDK v2.4.4 Release Notes
      • nRF Connect SDK v2.4.3 Release Notes
      • nRF Connect SDK v2.4.2 Release Notes
      • nRF Connect SDK v2.4.1 Release Notes
      • nRF Connect SDK v2.4.0 Release Notes
      • nRF Connect SDK v2.3.0 Release Notes
      • nRF Connect SDK v2.2.0 Release Notes
      • nRF Connect SDK v2.1.4 Release Notes
      • nRF Connect SDK v2.1.3 Release Notes
      • nRF Connect SDK v2.1.2 Release Notes
      • nRF Connect SDK v2.1.1 Release Notes
      • nRF Connect SDK v2.1.0 Release Notes
      • nRF Connect SDK v2.0.2 Release Notes
      • nRF Connect SDK v2.0.1 Release Notes
      • nRF Connect SDK v2.0.0 Release Notes
      • nRF Connect SDK v1.9.2 Release Notes
      • nRF Connect SDK v1.9.1 Release Notes
      • nRF Connect SDK v1.9.0 Release Notes
      • nRF Connect SDK v1.8.0 Release Notes
      • nRF Connect SDK v1.7.1 Release Notes
      • nRF Connect SDK v1.7.0 Release Notes
      • nRF Connect SDK v1.6.1 Release Notes
      • nRF Connect SDK v1.6.0 Release Notes
      • nRF Connect SDK v1.5.2 Release Notes
      • nRF Connect SDK v1.5.1 Release Notes
      • nRF Connect SDK v1.5.0 Release Notes
      • nRF Connect SDK v1.4.2 Release Notes
      • nRF Connect SDK v1.4.1 Release Notes
      • nRF Connect SDK v1.4.0 Release Notes
      • nRF Connect SDK v1.3.2 Release Notes
      • nRF Connect SDK v1.3.1 Release Notes
      • nRF Connect SDK v1.3.0 Release Notes
      • nRF Connect SDK v1.2.1 Release Notes
      • nRF Connect SDK v1.2.0 Release Notes
      • nRF Connect SDK v1.1.0 Release Notes
      • nRF Connect SDK v1.0.0 Release Notes
      • nRF Connect SDK v0.4.0 Release Notes
      • nRF Connect SDK v0.3.0 Release Notes
      • nRF Connect SDK v0.1.0 Release Notes
    • Migration guides
      • Migration notes for nRF Connect SDK v3.5.0 (Working draft)
      • Migration notes for nRF Connect SDK v3.4.0 (Working draft)
      • Migration notes for nRF Connect SDK v3.3.0
      • Migration notes for nRF Connect SDK v3.2.0
      • Migration notes for nRF Connect SDK v3.1.0
      • Migration notes for nRF Connect SDK v3.0.0
      • Migration notes for nRF Connect SDK v2.9.0
      • Migration notes for nRF Connect SDK v2.8.0
      • Migration notes for nRF Connect SDK v2.7.0
      • Migration notes for nRF Connect SDK v2.6.0
      • Migration notes for nRF Connect SDK v2.5.0
      • Migration notes for nRF Connect SDK v2.0.0
      • Migration notes for nRF Connect SDK v2.9.0-nRF54H20-1
      • Migrating applications from nRF Connect SDK v3.0.0 (SUIT) to nRF Connect SDK v3.1.0 (IronSide SE) on the nRF54H20 SoC
      • Migrating nRF54H20 SoC BICR from DTS to JSON
      • Migration notes for nRF Connect SDK v2.6.99_cs2 for v2.4.99-cs3 users
        • Update your development environment for nRF Connect SDK v2.6.99_cs2 (for v2.4.99-cs3 users)
        • Migrate your application to nRF Connect SDK v2.6.99_cs2 (for v2.4.99-cs3 users)
      • Migration notes for nRF Connect SDK v2.7.99-cs2 and the nRF54H20 DK
      • Migration notes for nRF Connect SDK v2.7.99-cs1 and the nRF54H20 DK
      • Migration notes for nRF Connect SDK v2.7.0 and the nRF54H20 DK
        • Transition your development environment to nRF Connect SDK v2.7.0 (for v2.4.99-cs3 users)
        • Migrate your application for the nRF54H20 DK to nRF Connect SDK v2.7.0 (for v2.4.99-cs3 users)
        • Migrate your development environment to nRF Connect SDK v2.7.0 (for v2.6.99-cs2 users)
        • Migrate your application for the nRF54H20 DK to nRF Connect SDK v2.7.0 (for v2.6.99-cs2 users)
      • Migrating from multi-image builds to sysbuild
      • Migrating partition configuration from Partition Manager to devicetree (DTS)
    • nRF Connect SDK repository revisions
    • Software maturity levels
    • IronSide SE ABI compatibility
    • Known issues
  • Glossary
nRF Connect SDK
  • Libraries
  • Modem libraries
  • LTE link control
  • Open on GitHub

LTE link control

  • Configuration

    • Establishing an LTE connection

    • Enabling power-saving features

    • Connection pre-evaluation

    • Modem sleep and TAU pre-warning notifications

    • Environment evaluation

    • PDN management

  • Limitations

  • Dependencies

  • API documentation

The LTE link control library provides functionality to control the LTE link on an nRF91 Series SiP.

The LTE link can be controlled through library configurations and API calls to enable a range of features such as specifying the Access Point Name (APN), switching between LTE network modes (NB-IoT or LTE-M), enabling GNSS support and power saving features such as Power Saving Mode (PSM) and enhanced Discontinuous Reception (eDRX).

The library also provides functionality that enables the application to receive notifications regarding LTE link parameters such as Radio Resource Control (RRC) connection state, cell information, and the provided PSM or eDRX timer values.

To use the LTE link control library, the Modem library is required.

Configuration

To enable the library, set the Kconfig option CONFIG_LTE_LINK_CONTROL to y in the project configuration file prj.conf.

Note

By default, the library enables only the core features related to the network connectivity.

Establishing an LTE connection

The following block of code shows how you can use the API to establish an LTE connection and get callbacks from the library:

#include <zephyr/kernel.h>
#include <modem/lte_lc.h>

/* Semaphore used to block the main thread until modem has established
 * an LTE connection.
 */
K_SEM_DEFINE(lte_connected, 0, 1);

static void lte_handler(const struct lte_lc_evt *const evt)
{
        switch (evt->type) {
        case LTE_LC_EVT_NW_REG_STATUS:
                if (evt->nw_reg_status != LTE_LC_NW_REG_REGISTERED_HOME &&
                    evt->nw_reg_status != LTE_LC_NW_REG_REGISTERED_ROAMING) {
                        break;
                }

                printk("Connected to: %s network\n",
                       evt->nw_reg_status == LTE_LC_NW_REG_REGISTERED_HOME ? "home" : "roaming");

                k_sem_give(&lte_connected);
                break;

        case LTE_LC_EVT_RRC_UPDATE:
        case LTE_LC_EVT_CELL_UPDATE:
        case LTE_LC_EVT_LTE_MODE_UPDATE:
        case LTE_LC_EVT_MODEM_EVENT:
                /* Handle LTE events that are enabled by default. */
                break;

        default:
                break;
        }
}

int main(void)
{
        int err;

        printk("Connecting to LTE network. This may take a few minutes...\n");

        err = lte_lc_connect_async(lte_handler);
        if (err) {
                printk("lte_lc_connect_async, error: %d\n", err);
                return 0;
        }

        k_sem_take(&lte_connected, K_FOREVER);

        /* Continue execution... */
}

The code block demonstrates how you can use the library to asynchronously set up an LTE connection.

Additionally, to enable specific functionalities and receive specific events from the library, you must enable the corresponding modules through their respective Kconfig options:

Connection Parameters Evaluation:

Use the CONFIG_LTE_LC_CONN_EVAL_MODULE Kconfig option to enable the following functionality related to Connection Parameters Evaluation:

  • lte_lc_conn_eval_params_get()

eDRX (Extended Discontinuous Reception):

Use the CONFIG_LTE_LC_EDRX_MODULE Kconfig option to enable all the following functionalities related to eDRX:

  • LTE_LC_EVT_EDRX_UPDATE events

  • lte_lc_ptw_set()

  • lte_lc_edrx_param_set()

  • lte_lc_edrx_req()

  • lte_lc_edrx_get()

  • CONFIG_LTE_EDRX_REQ

Neighboring Cell Measurements:

Use the CONFIG_LTE_LC_NEIGHBOR_CELL_MEAS_MODULE Kconfig option to enable all the following functionalities related to Neighboring Cell Measurements:

  • LTE_LC_EVT_NEIGHBOR_CELL_MEAS events

  • lte_lc_neighbor_cell_measurement_cancel()

  • lte_lc_neighbor_cell_measurement()

Periodic Search Configuration:

Use the CONFIG_LTE_LC_PERIODIC_SEARCH_MODULE Kconfig option to enable all the following functionalities related to Periodic Search Configuration:

  • lte_lc_periodic_search_request()

  • lte_lc_periodic_search_clear()

  • lte_lc_periodic_search_get()

  • lte_lc_periodic_search_set()

PSM (Power Saving Mode):

Use the CONFIG_LTE_LC_PSM_MODULE Kconfig option to enable all the following functionalities related to PSM:

  • LTE_LC_EVT_PSM_UPDATE events

  • lte_lc_psm_param_set()

  • lte_lc_psm_param_set_seconds()

  • lte_lc_psm_req()

  • lte_lc_psm_get()

  • lte_lc_proprietary_psm_req()

  • CONFIG_LTE_PSM_REQ

Release Assistance Indication (RAI):

Use the CONFIG_LTE_LC_RAI_MODULE Kconfig option to enable the following functionalities related to RAI:

  • LTE_LC_EVT_RAI_UPDATE events

  • CONFIG_LTE_RAI_REQ

Modem Sleep Notifications:

Use the CONFIG_LTE_LC_MODEM_SLEEP_MODULE Kconfig option to enable all the following functionalities related to Modem Sleep Notifications:

  • LTE_LC_EVT_MODEM_SLEEP_EXIT_PRE_WARNING events

  • LTE_LC_EVT_MODEM_SLEEP_ENTER events

  • LTE_LC_EVT_MODEM_SLEEP_EXIT events

  • CONFIG_LTE_LC_MODEM_SLEEP_NOTIFICATIONS

Tracking Area Update (TAU) Pre-warning:

Use the CONFIG_LTE_LC_TAU_PRE_WARNING_MODULE Kconfig option to enable the following functionalities related to TAU Pre-warning:

  • LTE_LC_EVT_TAU_PRE_WARNING events

  • CONFIG_LTE_LC_TAU_PRE_WARNING_NOTIFICATIONS

DNS Fallback:

The CONFIG_LTE_LC_DNS_FALLBACK_MODULE Kconfig option controls the use of a fallback DNS server address.

The device might or might not receive a DNS server address by the network during a PDN connection. Even within the same network, the PDN connection establishment method (PCO vs ePCO) might change when the device operates in NB-IoT or LTE Cat-M1, and result in missing DNS server addresses when one method is used, but not the other. Setting a fallback DNS address ensures that the device always has a DNS server address to fallback to regardless of whether the network has provided one.

The CONFIG_LTE_LC_DNS_FALLBACK_MODULE Kconfig option is enabled by default. If the application has configured a DNS server address in Zephyr’s native networking stack using the CONFIG_DNS_SERVER1 Kconfig option, the same server is set as the fallback address for DNS queries offloaded to the nRF91 Series modem. Otherwise, the CONFIG_LTE_LC_DNS_FALLBACK_ADDRESS Kconfig option controls the fallback DNS server address that is set to Cloudflare’s DNS server: 1.1.1.1 by default.

Environment Evaluation:

Use the CONFIG_LTE_LC_ENV_EVAL_MODULE Kconfig option to enable the following functionalities related to Environment Evaluation:

  • LTE_LC_EVT_ENV_EVAL_RESULT events

  • lte_lc_env_eval()

  • lte_lc_env_eval_cancel()

PDN (Packet Data Network):

Use the CONFIG_LTE_LC_PDN_MODULE Kconfig option to enable all the following functionalities related to PDP context and PDN connection management:

  • LTE_LC_EVT_PDN_ACTIVATED events

  • LTE_LC_EVT_PDN_DEACTIVATED events

  • LTE_LC_EVT_PDN_IPV6_UP events

  • LTE_LC_EVT_PDN_IPV6_DOWN events

  • LTE_LC_EVT_PDN_NETWORK_DETACH events

  • LTE_LC_EVT_PDN_APN_RATE_CONTROL_ON events

  • LTE_LC_EVT_PDN_APN_RATE_CONTROL_OFF events

  • LTE_LC_EVT_PDN_CTX_DESTROYED events

  • LTE_LC_EVT_PDN_ESM_ERROR events

  • lte_lc_pdn_ctx_create()

  • lte_lc_pdn_ctx_configure()

  • lte_lc_pdn_ctx_auth_set()

  • lte_lc_pdn_activate()

  • lte_lc_pdn_deactivate()

  • lte_lc_pdn_ctx_destroy()

  • lte_lc_pdn_id_get()

  • lte_lc_pdn_dynamic_info_get()

  • lte_lc_pdn_default_ctx_apn_get()

  • lte_lc_pdn_esm_strerror()

  • CONFIG_LTE_LC_PDN_DEFAULTS_OVERRIDE

For more information on the callback events received in lte_lc_evt_handler_t and data associated with each event, see the documentation on lte_lc_evt. For more information on the functions and data associated with each, refer to the API documentation.

Note

Some of the functionalities might not be compatible with certain modem firmware versions. To check if a desired feature is compatible with a certain modem firmware version, see the AT commands that are documented in the nRF91x1 AT Commands Reference Guide or nRF9160 AT Commands Reference Guide depending on the SiP you are using.

Enabling power-saving features

To enable power-saving features, use the following options:

  • CONFIG_LTE_LC_PSM_MODULE

  • CONFIG_LTE_LC_EDRX_MODULE

  • CONFIG_LTE_PSM_REQ

  • CONFIG_LTE_EDRX_REQ

PSM and eDRX can also be requested at run time using the lte_lc_psm_req() and lte_lc_edrx_req() function calls. However, calling the functions during modem initialization can lead to conflicts with the value set by the Kconfig options.

You can set the timer values requested by the modem using the following options:

  • CONFIG_LTE_PSM_REQ_RPTAU

  • CONFIG_LTE_PSM_REQ_RAT

  • CONFIG_LTE_EDRX_REQ_VALUE_LTE_M

  • CONFIG_LTE_EDRX_REQ_VALUE_NBIOT

  • CONFIG_LTE_PTW_VALUE_LTE_M

  • CONFIG_LTE_PTW_VALUE_NBIOT

Note

A timer value that is requested by the modem is not necessarily given by the network. The event callbacks LTE_LC_EVT_PSM_UPDATE and LTE_LC_EVT_EDRX_UPDATE contain the values that are actually decided by the network.

Connection pre-evaluation

Modem firmware versions 1.3.0 and higher support a connection pre-evaluation feature that allows the application to get information about a cell that is likely to be used for an RRC connection. Based on the parameters received in the function call, the application can decide whether to send application data or not. To enable this module, use the CONFIG_LTE_LC_CONN_EVAL_MODULE Kconfig option. The function lte_lc_conn_eval_params_get() populates a structure of type lte_lc_conn_eval_params that includes information on the current consumption cost by the data transmission when utilizing the given cell. The following code snippet shows a basic implementation of lte_lc_conn_eval_params_get():

...

int main(void)
{
        int err;

        printk("Connecting to LTE network. This may take a few minutes...\n");

        err = lte_lc_connect_async(lte_handler);
        if (err) {
                printk("lte_lc_connect_async, error: %d\n", err);
                return 0;
        }

        k_sem_take(&lte_connected, K_FOREVER);

        struct lte_lc_conn_eval_params params = {0};

        err = lte_lc_conn_eval_params_get(&params);
        if (err) {
                printk("lte_lc_conn_eval_params_get, error: %d\n", err);
                return 0;
        }

        /* Handle connection evaluation parameters... */

        /* Continue execution... */
}

The lte_lc_conn_eval_params structure lists all information that is available when performing connection pre-evaluation.

Modem sleep and TAU pre-warning notifications

Modem firmware versions 1.3.0 and higher support receiving callbacks from the modem related to Tracking Area Updates (TAU) and modem sleep. Based on these notifications, the application can alter its behavior to optimize for a given metric.

For instance, TAU pre-warning notifications can be used to schedule data transfers before a TAU so that data transfer and TAU occurs within the same RRC connection window, thereby saving the potential overhead associated with the additional data exchange.

Modem sleep notifications can be used to schedule processing in the same operational window as the modem to limit the overall computation time of the nRF91 Series SiP.

To enable modem sleep and TAU pre-warning notifications, use the following options:

  • CONFIG_LTE_LC_MODEM_SLEEP_MODULE

  • CONFIG_LTE_LC_TAU_PRE_WARNING_MODULE

  • CONFIG_LTE_LC_MODEM_SLEEP_NOTIFICATIONS

  • CONFIG_LTE_LC_TAU_PRE_WARNING_NOTIFICATIONS

For additional configurations related to these features, see the API documentation.

Environment evaluation

Modem firmware mfw_nrf91x1 v2.0.3 and higher, and mfw_nrf9151-ntn support environment evaluation. Environment evaluation allows the application to evaluate available PLMNs and select the best PLMN to use before connecting to the network. This is useful especially in cases where the device has multiple SIMs or SIM profiles to select from.

Environment evaluation can only be performed in receive only functional mode. During the environment evaluation, the device searches for the best cell for each PLMN.

The lte_lc_env_eval() function starts the environment evaluation for the given PLMNs. When the environment evaluation is complete, an LTE_LC_EVT_ENV_EVAL_RESULT event with the evaluation results is received. For each found PLMN, the lte_lc_conn_eval_params structure is populated with the evaluation results.

PDN management

The LTE link control library provides functionality to manage Packet Data Protocol (PDP) contexts and Packet Data Network (PDN) connections.

The PDN functionality provides the following capabilities:

  • Creating and configuring PDP contexts

  • Receiving events pertaining to PDN connections

  • Managing PDN connections

  • Retrieving PDN connection information

To enable PDN functionality, set the CONFIG_LTE_LC_PDN_MODULE Kconfig option to y.

AT commands used

The PDN functionality uses several AT commands, and it relies on the following two types of AT notifications to work:

  • Packet domain events notifications (+CGEV) - Subscribed by using the AT+CGEREP=1 command. See the AT+CGEREP set command section in the nRF9160 AT Commands Reference Guide or the nRF91x1 AT+CGEREP set command section in the nRF91x1 AT Commands Reference Guide, depending on the SiP you are using.

  • Notifications for unsolicited reporting of error codes sent by the network (+CNEC) - Subscribed by using the AT+CNEC=16 command. See the AT+CNEC set command section in the nRF9160 AT Commands Reference Guide or the nRF91x1 AT+CNEC set command section in the nRF91x1 AT Commands Reference Guide, depending on the SiP you are using.

The LTE link control library automatically subscribes to the necessary AT notifications. This includes automatically resubscribing to the notifications upon functional mode changes.

Note

The subscription to AT notifications is lost upon changing the functional mode of the modem to +CFUN=0. If the application subscribes to these notifications manually, it must also take care of resubscription.

Following are the AT commands that are used by the PDN functionality:

  • AT%XNEWCID - To create a PDP context

  • AT+CGDCONT - To configure or destroy a PDP context

  • AT+CGACT - To activate or deactivate a PDN connection

  • AT%XGETPDNID - To retrieve the PDN ID for a given PDP context

  • AT+CGAUTH - To set the PDN connection authentication parameters

For more information about these commands, see Packet Domain AT commands in the nRF9160 AT Commands Reference Guide or the nRF91x1 packet Domain AT commands section in the nRF91x1 AT Commands Reference Guide, depending on the SiP you are using.

Creating and managing PDN connections

The application can create PDP contexts by using the lte_lc_pdn_ctx_create() function. PDN events are sent to all registered LTE link control event handlers. The application can use the lte_lc_register_handler() function to register an event handler for events pertaining to all PDP contexts, including the default PDP context.

A PDN connection is identified by an ID as reported by AT%XGETPDNID, and it is distinct from the PDP context ID (CID). The modem creates a PDN connection for a PDP context as necessary. Multiple PDP contexts might share the same PDN connection if they are configured similarly.

The application can use the following functions to manage PDP contexts and PDN connections:

  • lte_lc_pdn_ctx_create() - Creates a PDP context.

  • lte_lc_register_handler() - Registers an event handler for events pertaining to all PDP contexts, including the default PDP context.

  • lte_lc_pdn_ctx_configure() - Configures a PDP context with address family, access point name, and optional additional configuration options.

  • lte_lc_pdn_ctx_auth_set() - Sets authentication parameters for a PDP context.

  • lte_lc_pdn_activate() - Activates a PDN connection for a PDP context.

  • lte_lc_pdn_deactivate() - Deactivates a PDN connection.

  • lte_lc_pdn_ctx_destroy() - Destroys a PDP context. The PDN connection must be inactive when the PDP context is destroyed.

  • lte_lc_pdn_id_get() - Retrieves the PDN ID for a given PDP context. The PDN ID can be used to route traffic through a specific PDN connection.

  • lte_lc_pdn_dynamic_info_get() - Retrieves dynamic parameters such as DNS addresses and MTU sizes for a given PDN connection.

  • lte_lc_pdn_default_ctx_apn_get() - Retrieves the default Access Point Name (APN) of the default PDP context (CID 0).

PDN events

The following PDN events are sent to registered LTE link control event handlers:

  • LTE_LC_EVT_PDN_ACTIVATED - PDN connection activated

  • LTE_LC_EVT_PDN_DEACTIVATED - PDN connection deactivated

  • LTE_LC_EVT_PDN_IPV6_UP - PDN has IPv6 connectivity

  • LTE_LC_EVT_PDN_IPV6_DOWN - PDN has lost IPv6 connectivity

  • LTE_LC_EVT_PDN_NETWORK_DETACH - PDN connection lost due to network detach

  • LTE_LC_EVT_PDN_APN_RATE_CONTROL_ON - APN rate control is active

  • LTE_LC_EVT_PDN_APN_RATE_CONTROL_OFF - APN rate control is inactive

  • LTE_LC_EVT_PDN_CTX_DESTROYED - PDP context destroyed

  • LTE_LC_EVT_PDN_ESM_ERROR - ESM error occurred

The associated payload for PDN events is the lte_lc_evt.pdn member of type lte_lc_pdn_evt. This structure contains the PDP context ID (CID) and, for LTE_LC_EVT_PDN_ESM_ERROR events, the ESM error code.

PDN configuration

The LTE link control library can override the default PDP context configuration automatically after the Modem library is initialized, if the CONFIG_LTE_LC_PDN_DEFAULTS_OVERRIDE Kconfig option is set. The default PDP context configuration consists of the following parameters, each controlled with a Kconfig setting:

  • Access point name - CONFIG_LTE_LC_PDN_DEFAULT_APN

  • Address family - CONFIG_LTE_LC_PDN_DEFAULT_FAM_IPV4, CONFIG_LTE_LC_PDN_DEFAULT_FAM_IPV6, CONFIG_LTE_LC_PDN_DEFAULT_FAM_IPV4V6, or CONFIG_LTE_LC_PDN_DEFAULT_FAM_NONIP

  • Authentication method - CONFIG_LTE_LC_PDN_DEFAULT_AUTH_NONE, CONFIG_LTE_LC_PDN_DEFAULT_AUTH_PAP, or CONFIG_LTE_LC_PDN_DEFAULT_AUTH_CHAP

  • Authentication credentials - CONFIG_LTE_LC_PDN_DEFAULT_USERNAME and CONFIG_LTE_LC_PDN_DEFAULT_PASSWORD

Note

The default PDP context configuration must be overridden before the device is registered with the network.

Additional configuration options:

  • CONFIG_LTE_LC_PDN_LEGACY_PCO - Use legacy PCO mode instead of ePCO during PDN connection establishment

  • CONFIG_LTE_LC_PDN_ESM_TIMEOUT - Timeout for waiting for an ESM notification when activating a PDN

  • CONFIG_LTE_LC_PDN_ESM_STRERROR - Compile a table with textual descriptions of ESM error reasons

PDN usage example

The following code snippet demonstrates how to use the PDN functionality:

#include <zephyr/kernel.h>
#include <modem/lte_lc.h>

static void lte_handler(const struct lte_lc_evt *const evt)
{
        switch (evt->type) {
        case LTE_LC_EVT_PDN_ACTIVATED:
                printk("PDN context %d activated\n", evt->pdn.cid);
                break;
        case LTE_LC_EVT_PDN_DEACTIVATED:
                printk("PDN context %d deactivated\n", evt->pdn.cid);
                break;
        case LTE_LC_EVT_PDN_ESM_ERROR:
                printk("PDN context %d ESM error: %d\n",
                       evt->pdn.cid, evt->pdn.esm_err);
                break;
        default:
                break;
        }
}

int main(void)
{
        int err;
        uint8_t cid;
        int esm;
        char apn[32];
        int pdn_id;

        err = lte_lc_register_handler(lte_handler);
        if (err) {
                LOG_ERR("Registration failed, error: %d", err);

                return err;
        }

        err = lte_lc_connect();
        if (err) {
                return err;
        }

        /* Get default APN */
        err = lte_lc_pdn_default_ctx_apn_get(apn, sizeof(apn));
        if (err) {
                return err;
        }

        /* Create a new PDP context */
        err = lte_lc_pdn_ctx_create(&cid);
        if (err) {
                return err;
        }

        /* Configure the PDP context */
        err = lte_lc_pdn_ctx_configure(cid, apn, LTE_LC_PDN_FAM_IPV4V6, NULL);
        if (err) {
                return err;
        }

        /* Activate the PDN connection */
        err = lte_lc_pdn_activate(cid, &esm, NULL);
        if (err) {
                LOG_ERR("Activation failed, ESM error: %d", esm);

                return err;
        }

        /* Get PDN ID */
        pdn_id = lte_lc_pdn_id_get(cid);
        if (pdn_id < 0) {
                return pdn_id;
        }

        LOG_INF("PDN connection activated with PDN ID: %d", pdn_id);

        /* Continue execution... */
}

Note

You have to register the event handler for LTE events before the device is registered to the network (CFUN=1) to receive the first activation event.

Limitations

The LTE link control library and the AT commands interface should be used at the same time with caution, because the library also uses the same interface. As a general rule, do not use the AT commands for features that the LTE link control library supports.

Dependencies

This library uses the following nRF Connect SDK library:

  • Modem library

API documentation

Header file: include/modem/lte_lc.h
Source file: lib/lte_link_control/lte_lc.c
LTE link control library

© Copyright 2019-2026, Nordic Semiconductor. Last updated on Jun 10, 2026.

nRF Connect SDK
nRF Connect SDK
nrfxlib
Zephyr Project
MCUboot
Trusted Firmware-M
Matter
Kconfig Reference