Configuration
See Configuring and building in the nRF Connect SDK documentation for information about how to permanently or temporarily change the configuration.
Configuration options
- CONFIG_SM_CUSTOMER_VERSION - Customer version string
Version string defined by the customer after customizing the application. When defined, this version is reported with the baseline versions by the
AT#XSMVERAT command.
- CONFIG_SM_CMUX - Enable CMUX functionality
This option is enabled by the CMUX overlay. It adds support for CMUX. See CMUX AT commands for more information.
- CONFIG_SM_PPP - Enable PPP functionality
This option is enabled by the PPP overlay. It adds support for PPP. PPP can be used in conjunction with CMUX in order to use a single UART for both AT data and PPP. When CMUX is also enabled, PPP is usable only through a CMUX channel. See PPP AT commands for more information.
- CONFIG_SM_EXTERNAL_XTAL - Use external XTAL for UARTE
This option configures the application to use an external XTAL for UARTE. For more information, see the UARTE - Universal asynchronous receiver/transmitter with EasyDMA section of the nRF9151 Product Specification documentation.
- CONFIG_SM_AUTO_CONNECT - Connect to the network at start-up or reset
This option enables connecting to the network at start-up or reset using a defined PDN configuration. This option is enabled by the LwM2M Carrier overlay, but is otherwise disabled by default.
When enabled, the following sub-options are available for configuration:
- CONFIG_SM_AUTO_CONNECT_SYSTEM_MODE - System mode for automatic network attach
This option defines the system mode to use for automatic network attach. The format is a comma-separated string of four single-digit integers:
"X,Y,Z,W"Where:
X= LTE-M support (0=disabled, 1=enabled)Y= NB-IoT support (0=disabled, 1=enabled)Z= GNSS support (0=disabled, 1=enabled)W= LTE preference (0=no preference, 1=LTE-M, 2=NB-IoT, 3=network selection, 4=LTE-M then NB-IoT)
See the %XSYSTEMMODE command in the AT command Reference Guide for more details. The default value is
"1,1,1,0"(enable LTE-M, NB-IoT, and GNSS with no preference).
- CONFIG_SM_AUTO_CONNECT_PDN_CONFIG - Enable PDN configuration
This option enables sending of PDN configuration commands during automatic network attach. When enabled, the following sub-options become available:
- CONFIG_SM_AUTO_CONNECT_PDN_APN - Access Point Name (APN)
This option specifies the APN to use for automatic network attach. If not set (default), the APN configured in the modem will be used.
- CONFIG_SM_AUTO_CONNECT_PDN_FAMILY - PDN family (IP type)
This choice option selects the PDN family (IP address type) to use for automatic network attach. See the +CGDCONT command in the AT command Reference Guide for more details.
Available options:
CONFIG_SM_AUTO_CONNECT_PDN_FAMILY_IP- Use IPv4 onlyCONFIG_SM_AUTO_CONNECT_PDN_FAMILY_IPV6- Use IPv6 onlyCONFIG_SM_AUTO_CONNECT_PDN_FAMILY_IPV4V6- Use both IPv4 and IPv6 (dual stack, default)CONFIG_SM_AUTO_CONNECT_PDN_FAMILY_NON_IP- Use Non-IP PDN type for data transmission without IP headers
- CONFIG_SM_AUTO_CONNECT_PDN_AUTH - PDN authentication type
This option specifies the PDN authentication protocol to use for automatic network attach. See the +CGAUTH command in the AT command Reference Guide for more details.
Valid values:
0- None (no authentication, default)1- PAP (Password Authentication Protocol)2- CHAP (Challenge Handshake Authentication Protocol)
- CONFIG_SM_AUTO_CONNECT_PDN_USERNAME - PDN authentication username
This option specifies the username to use for PDN authentication during automatic network attach. Do not set the Kconfig option (default) if no username is required. Use only when CONFIG_SM_AUTO_CONNECT_PDN_AUTH is set to 1 (PAP) or 2 (CHAP).
- CONFIG_SM_AUTO_CONNECT_PDN_PASSWORD - PDN authentication password
This option specifies the password to use for PDN authentication during automatic network attach. Leave empty (default) if no password is required. Use only when CONFIG_SM_AUTO_CONNECT_PDN_AUTH is set to 1 (PAP) or 2 (CHAP).
Example configuration overlay for NB-IoT with Non-IP PDN:
CONFIG_SM_AUTO_CONNECT=y CONFIG_SM_AUTO_CONNECT_SYSTEM_MODE="0,1,0,0" CONFIG_SM_AUTO_CONNECT_PDN_CONFIG=y CONFIG_SM_AUTO_CONNECT_PDN_FAMILY_NON_IP=y
Example configuration overlay for LTE-M with custom APN and PAP authentication:
CONFIG_SM_AUTO_CONNECT=y CONFIG_SM_AUTO_CONNECT_SYSTEM_MODE="1,0,0,0" CONFIG_SM_AUTO_CONNECT_PDN_CONFIG=y CONFIG_SM_AUTO_CONNECT_PDN_APN="internet" CONFIG_SM_AUTO_CONNECT_PDN_FAMILY_IPV4V6=y CONFIG_SM_AUTO_CONNECT_PDN_AUTH=1 CONFIG_SM_AUTO_CONNECT_PDN_USERNAME="myuser" CONFIG_SM_AUTO_CONNECT_PDN_PASSWORD="mypass"
- CONFIG_SM_CR_TERMINATION - CR termination
This option configures the application to accept AT commands ending with a carriage return. This is the default AT command terminator.
Select this option if you want to connect to the development kit using PuTTY. See Testing and optimization for instructions.
- CONFIG_SM_LF_TERMINATION - LF termination
This option configures the application to accept AT commands ending with a line feed.
- CONFIG_SM_CR_LF_TERMINATION - CR+LF termination
This option configures the application to accept AT commands ending with a carriage return followed by a line feed.
- CONFIG_SM_SMS - SMS support in Serial Modem
This option enables additional AT commands for using the SMS service.
- CONFIG_SM_GNSS - GNSS support in Serial Modem
This option enables additional AT commands for using the GNSS service.
- CONFIG_SM_NRF_CLOUD - nRF Cloud support in Serial Modem
This option enables additional AT commands for using the nRF Cloud service.
- CONFIG_SM_NRF_CLOUD_LOCATION - nRF Cloud Location support
This option enables the nRF Cloud Location Services for cloud-assisted geolocation. Supports cellular and Wi-Fi positioning. This requires CONFIG_SM_NRF_CLOUD to be enabled.
- CONFIG_SM_NRF_CLOUD_OBSERVABILITY - nRF Cloud observability support
This option enables the
#XNRFCLOUDOBS*commands, which control the Memfault data upload over the nRF Cloud CoAP transport. This requires CONFIG_SM_NRF_CLOUD andCONFIG_MEMFAULT_USE_NRF_CLOUD_COAPto be enabled. See nRF Cloud observability for more information.
- CONFIG_SM_NRF_CLOUD_OBSERVABILITY_AUTO_INTERVAL_SECONDS - Default interval of the automatic upload
This option sets the interval, in seconds, that
#XNRFCLOUDOBSAUTOuses when the host enables the automatic upload without giving one, and no interval has been stored yet. It defaults to one hour. The interval the host gives is persistent, so this value only applies until the host configures one. This requires CONFIG_SM_NRF_CLOUD_OBSERVABILITY to be enabled.
- CONFIG_SM_NRF_CLOUD_OBSERVABILITY_DEBUG - Debug observability commands
This option enables the
#XNRFCLOUDOBSDEVINFO,#XNRFCLOUDOBSCRASHand#XNRFCLOUDOBSEXPORTcommands, which return the Memfault device information, force a crash for testing the coredump capture, and print the buffered Memfault chunks to the AT interface. It is disabled by default, because#XNRFCLOUDOBSCRASHdeliberately crashes the application. Enable it only in development builds. This requires CONFIG_SM_NRF_CLOUD_OBSERVABILITY to be enabled.
- CONFIG_SM_NRF_CLOUD_OBSERVABILITY_LTE_METRICS - Additional LTE metrics for Memfault
This option collects the cell ID, the tracking area code, the LTE mode, the PSM active time and periodic TAU, and the eDRX interval and paging time window on each Memfault heartbeat. It is enabled by default. This requires CONFIG_SM_NRF_CLOUD_OBSERVABILITY and
CONFIG_MEMFAULT_NCS_LTE_METRICSto be enabled.
- CONFIG_SM_COAPC - CoAP client support in Serial Modem
This option enables the CoAP client AT commands for making CoAP requests. See CoAP client AT commands for more information.
- CONFIG_SM_MQTTC - MQTT client support in Serial Modem
This option enables additional AT commands for using the MQTT client service.
- CONFIG_SM_MQTTC_MESSAGE_BUFFER_LEN - Size of the buffer for the MQTT library
This option specifies the maximum message size which can be transmitted or received through MQTT (excluding PUBLISH payload). The default value is 512, meaning 512 bytes for TX and RX, respectively.
- CONFIG_SM_HTTPC - HTTP client support in Serial Modem
This option enables the HTTP client AT commands for making HTTP/HTTPS requests. See HTTP client AT commands for more information.
When enabled, the following sub-option is available:
- CONFIG_SM_HTTPC_RESPONSE_TIMEOUT_MS - HTTP client idle timeout (ms)
Idle timeout for an active HTTP request in milliseconds. The timer is a sliding window that resets each time data is sent or received (request headers, body upload chunks, and response body chunks). If no activity occurs within this window the request is aborted, and
#XHTTPCSTAT: <fd>,-1,<bytes>is reported. The default value is 30000 (30 seconds).
- CONFIG_SM_UART_RX_BUF_COUNT - Receive buffers for UART.
This option defines the number of buffers for receiving (RX) UART traffic. The default value is 3.
- CONFIG_SM_UART_RX_BUF_SIZE - Receive buffer size for UART.
This option defines the size of a single buffer for receiving (RX) UART traffic. The default value is 256.
- CONFIG_SM_UART_TX_BUF_SIZE - Send buffer size for UART.
This option defines the size of the buffer for sending (TX) UART traffic. The default value is 256.
- CONFIG_SM_URC_BUFFER_SIZE - URC buffer size.
Buffer, in which unsolicited result codes (URC) are stored before being sent to the host. The buffer has to be large enough to hold the largest URC that can be sent by the modem. Result codes longer than this size will get dropped. The default value is 4096.
- CONFIG_SM_PPP_FALLBACK_MTU - Control the MTU used by PPP.
This option controls the MTU used by PPP. PPP tries to retrieve the cellular link MTU from the modem (using
AT+CGCONTRDP). If MTU is not returned by the modem, this value will be used as a fallback. The MTU will be used for sending and receiving data on both the PPP and cellular links. The default value is 1280.
- CONFIG_SM_CARRIER_AUTO_STARTUP - Enable automatic startup on boot.
This option enables automatic startup of the library on device boot. If this configuration is disabled, automatic startup is controlled through a dedicated AT command.
- CONFIG_SM_PGPS_INJECT_FIX_DATA - Injects the data obtained when acquiring a fix.
This option, if enabled, when a fix is acquired the current location and time will be passed to the P-GPS subsystem. It allows you to speed up the time it takes to acquire the next fix when A-GNSS is disabled or unavailable. This can be detrimental to short TTFF if the device is expected to move distances longer than a few dozen kilometers between fix attempts. In that case, this option should be disabled. The default value is
y.
- CONFIG_SM_DFU_MODEM_FULL - Enable full modem DFU
This option enables support for full modem firmware updates using the
AT#XDFUINIT,AT#XDFUWRITE, andAT#XDFUAPPLYcommands. See the DFU AT commands for more information.
- CONFIG_SM_DEBUG_STATS_HEAP - Enable heap memory statistics
This option enables the
AT#XDBGSTATSMEMcommand for printing heap memory statistics. See the Memory statistics #XDBGSTATSMEM for more information.
- CONFIG_SM_DEBUG_STATS_THREAD_STACK - Enable thread stack memory statistics
This option enables thread stack memory statistics in the
AT#XDBGSTATSMEMcommand. See the Memory statistics #XDBGSTATSMEM for more information.
Configuration files
You can find the configuration files in the app directory.
Configuration files have a .conf or .overlay extension for Kconfig or devicetree overlays, respectively.
Board-specific configuration files are named <BOARD> with a .conf or .overlay extension and are located in the boards directory.
When the name of the board-specific configuration file matches the board target, the overlay is automatically included by the build system.
See Build and configuration system for more information on the nRF Connect SDK configuration system.
Important
When adding Kconfig fragments and devicetree overlays, make sure to use the EXTRA_CONF_FILE and EXTRA_DTC_OVERLAY_FILE CMake options, respectively. Otherwise, if CONF_FILE or DTC_OVERLAY_FILE is used, all the configuration files that normally get picked up automatically will have to be included explicitly.
The following configuration files are provided:
prj.conf- This configuration file contains the standard configuration for the Serial Modem application and is included by default by the build system.external-mcu.overlay- This configures the Serial Modem application to communicate with external MCU overuart2, using specific pins for UART, DTR, and RI. The overlay is pin compatible with nRF9151DK. For other setups, you can customize the overlay to fit your configuration.nrf91m1.overlay- Devicetree overlay for use with the nRF91M1 SiP. Configuresuart0anduart1with pins suitable for nRF9151 DK usage and for connecting to an external MCU. See nRF91M1 pre-programmed Serial Modem application for pin details.interposer-nrf9151-mk-bg95.overlay- Devicetree overlay for an nRF9151 SiP on an nRF9151-MK-BG95 interposer board. Configures theuart0pins to match the interposer footprint and removeshw-flow-control, as the interposer does not use the RTS and CTS signals for flow control. See Interposer boards for pin details.interposer-nrf9151-mk-gm02s.overlay- Devicetree overlay for an nRF9151 SiP on an nRF9151-MK-GM02S interposer board. Configures theuart0pins to match the interposer footprint and moves the DTR pin off the UART0 TX pin. See Interposer boards for pin details.carrier.conf- Configuration file that adds nRF Connect SDK LwM2M carrier support. Used in conjunction withcarrier.overlay. See Using the LwM2M carrier library for more information on how to connect to an operator’s device management platform.carrier.overlay- Devicetree overlay that adds a dedicated flash partition for the LwM2M carrier library NVS storage. Used in conjunction withcarrier.conf.carrier-softbank.confandsysbuild-softbank.conf- Configuration files that add SoftBank configurations needed by the carrier library. Used in conjunction withcarrier.confandcarrier.overlay. For more information, see the Carrier-specific dependencies section of the LwM2M carrier documentation.carrier-lgu.conf- This configuration file adds LG U+ configurations needed by the carrier library. Used in conjunction withcarrier.confandcarrier.overlay. For more information, see the Carrier-specific dependencies section of the LwM2M carrier documentation.cmux.conf- Configuration file that adds support for the CMUX protocol. See CMUX AT commands for more information.ppp.conf- Configuration file that adds support for the Point-to-Point Protocol (PPP). This disables most of the IP-based protocols available through AT commands (such as MQTT) as it is expected that the controlling chip’s own IP stack is used instead. See CONFIG_SM_PPP and PPP AT commands for more information.trace-backend-cmux.conf- Configuration file that enables CMUX modem trace backend. When enabled, modem traces are transmitted on a dedicated CMUX channel. Must be combined withtrace-backend.overlay. See the Modem traces through CMUX documentation for more information.trace-backend-uart.conf- Configuration file that enables the UART modem trace backend. Backend starts disabled and is activated at runtime usingAT#XTRACE. Must be combined withtrace-backend.overlay. See the Shared UART log and trace backend documentation for more information.trace-backend.overlay- Devicetree overlay that defines the SRAM partition used by the modem trace backend. Required when usingtrace-backend-uart.confortrace-backend-cmux.conf.nrfcloud-coredump-flash.conf- Configuration file that adds the flash-backed core dump to Memfault. Must be combined withnrfcloud-coredump-flash.overlay. For more information about Memfault features in nRF Connect SDK, see the Memfault library docs.Memfault is enabled by default in
prj.conf, without this overlay. Only the core dump requires the overlay, because it reserves a flash partition. To build without Memfault altogether, setCONFIG_MEMFAULTton.Note
The use of Memfault features in Serial Modem are Experimental.
nrfcloud-coredump-flash.overlay- Devicetree overlay that adds a dedicated flash partition for Memfault core dump storage. The overlay resizes the MCUboot primary and secondary slots to free up space for thememfault_coredump_partition. Must be combined withnrfcloud-coredump-flash.conf. Must also be passed to themcubootimage using mcuboot_EXTRA_DTC_OVERLAY_FILE so that MCUboot operates with the same partition layout. The absolute path to the overlay file must be provided.full-fota.conf- Configuration file that adds full modem FOTA support. Must be combined withfull-fota.overlay. See FOTA AT commands for more information on how to use full modem FOTA functionality.full-fota.overlay- Devicetree overlay that adds a dedicated flash partition for modem firmware storage in external flash. Must be combined withfull-fota.conf.pgps.overlay- Devicetree overlay that adds a dedicated flash partition for P-GPS prediction data storage. The overlay resizes the MCUboot primary and secondary slots to free up space for thepgps_partition. Required whenCONFIG_NRF_CLOUD_PGPSis enabled. Must also be passed to themcubootimage using mcuboot_EXTRA_DTC_OVERLAY_FILE so that MCUboot operates with the same partition layout. The absolute path to the overlay file must be provided. See GNSS AT commands for more information.disable-b0.overlay- Devicetree overlay for a build configuration without the NSIB (B0) immutable bootloader. This is intended only for upgrading v1.x.x devices to v2.x.x firmware. Must be combined withSB_CONFIG_SECURE_BOOT_APPCORE=nin the sysbuild configuration and passed to themcubootimage using mcuboot_EXTRA_DTC_OVERLAY_FILE (using the absolute path).disable-dtr.overlay- Devicetree overlay that disables the DTR and RI pins and related functionality. This overlay can be used if your setup does not have the need or means for managing the power externally. Modify the overlay to fit your configuration.nrf-device-provisioning.conf- Configuration file that enables the nRF Cloud device provisioning client and its AT command interface. See nRF Provisioning AT commands for more information.
The board-specific devicetree overlays (boards/*.overlay) set up configurations that are specific to each supported development kit.
All of them configure the DTR to be deasserted from a button and RI to drive an LED.
Flash and SRAM partition layouts
The Serial Modem application uses DTS-defined partitions instead of the nRF Connect SDK Partition Manager.
The base partition layout for the nRF9151 DK is defined in boards/nrf9151dk_nrf9151_ns.overlay.
Several DTS overlay files extend or replace parts of the layout for specific build configurations.