Logging and tracing
The nRF91M1 module outputs application logs and modem traces on UART1.
See nRF91M1 module pin assignment for the UART1 pins.
Application logging
The nRF91M1 module outputs B0, MCUboot, and application logs over UART1 during boot.
After the application is initialized, the log backend is disabled, and the UART is suspended.
Use AT#XLOG=1 or AT#XLOG=2 to enable application logs and resume the UART.
This avoids UART power overhead when logs are not needed during normal operation.
See Trace AT commands for the full command reference.
Nordic Semiconductor support might ask you for application logs when investigating an issue.
Note
The negative error codes that are visible in logs are errno codes defined in nrf_errno.h.
Log levels
The nRF91M1 module uses the following log levels, from the most severe to the most verbose:
Level |
Usage |
|---|---|
Error (ERR) |
An operation failed and the nRF91M1 module cannot complete it. |
Warning (WRN) |
Something unexpected happened, but the nRF91M1 module can continue. |
Information (INF) |
Normal operation. Includes the AT commands, responses, and notifications as text, with sensitive payloads redacted. |
Debug (DBG) |
Detailed internal information for debugging. Includes the AT commands, responses, and notifications as raw hex dumps. |
You select what the nRF91M1 module outputs on the log UART at runtime with the AT#XLOG command:
|
Log UART |
AT traffic logged as |
|---|---|---|
|
Suspended |
Not output |
|
Active |
Information level text, with sensitive payloads redacted |
|
Active |
Debug level hex dump |
Use mode 1 for normal troubleshooting.
Use mode 2 only when you need the exact bytes of the AT traffic, for example when the redaction hides the information that you need.
Mode 2 outputs sensitive payloads, such as credentials, so do not share these logs publicly.
Modem traces
The modem outputs modem traces that you can use to analyze the behavior of the modem. Collect the modem traces for the following purposes:
Inspecting the IP-level traffic during development.
Analyzing network issues.
Investigating modem crashes and suspected modem failures with the crash dump.
Nordic Semiconductor support might ask you for modem traces when investigating an issue.
Enable the modem traces before the problem occurs, because they cannot be collected afterwards. If the nRF91M1 module reports a modem fault with the #XMODEM: FAULT notification, or if you suspect another modem failure, repeat the scenario with the modem traces enabled.
Modem traces through UART
The nRF91M1 module outputs modem traces over UART1.
The UART is shared with the application logs.
The baud rate of the shared UART is set to 1000000 to support the high data rate required for modem traces.
Configuration
The application log output over UART1 and the modem trace backend (AT#XTRACE) are both included in the nRF91M1 module.
After the application is initialized, the UART is suspended.
Use AT#XLOG=1 to activate application logs and AT#XTRACE=1 to activate modem traces.
See Trace AT commands for the full command reference.
Note
Attempting to enable one backend while the other is active returns ERROR.
Always disable the active backend before enabling the other.
Note
When measuring power consumption, make sure both backends are disabled (AT#XLOG=0 and AT#XTRACE=0) so the UART stays suspended.
An active trace or log backend adds approximately 700 uA overhead.
Collecting traces
The modem traces cannot be enabled while the application logs are enabled, so send AT#XLOG=0 first.
To collect modem traces using the shared UART backend:
Capture the trace data from
UART1at 1000000 baud rate, for example, with the Cellular Monitor app. See the Cellular Monitor app documentation for how to capture and save the trace.Enable modem trace collection with the AT command UART:
AT#XTRACE=1 OK
Activate the modem to start generating trace data:
AT+CFUN=1 OK
Wait for the modem to register on the network and collect the traces.
When done, disable the modem trace backend:
AT#XTRACE=0 OK
Analyzing traces
You can analyze the captured trace file in the Cellular Monitor app to inspect AT commands, network events, and IP-level details of the communication between the modem and the cellular network.
If you suspect a modem failure, or if the modem crashes and the trace collection was enabled, you can send the trace file to Nordic Semiconductor support for further analysis.
nRF Cloud observability
The nRF91M1 module collects diagnostic data about its operation. The host can ask the nRF91M1 module to upload the data to nRF Cloud, so you can use it to investigate crashes of devices in the field.
The nRF91M1 module collects the following data:
Events, such as the reset reason after a restart and a modem fault with its reason and program counter.
Metrics, which the nRF91M1 module collects into a heartbeat every hour. The metrics include the LTE metrics and connection statistics. See #XNRFCLOUDOBSHEARTBEAT for more information.
Logs, which are the most recent information, warning, and error messages, with sensitive payloads redacted. The nRF91M1 module captures logs at these levels even when
AT#XLOG=0disables UART logging. WithAT#XLOG=2, the nRF91M1 module logs AT traffic only as debug-level hex dumps and does not include it in the observability logs. After a crash, the logs from before the crash are part of the core dump.A core dump, which the nRF91M1 module stores in flash when it crashes.
The data does not leave the device on its own. The host controls when it is sent, and the data reaches the cloud as follows:
The nRF91M1 module records the data on the device.
When the nRF91M1 module crashes, it stores a core dump in flash and restarts. The core dump stays in flash over the restart until it is uploaded. The nRF91M1 module keeps the other data in RAM, so the data is lost on reset or power loss.
The host connects the nRF91M1 module to nRF Cloud with the #XNRFCLOUD command. You must onboard and claim the device first. See nRF Provisioning AT commands.
The host uploads the buffered data with one of the following commands:
#XNRFCLOUDOBSUPLOAD uploads the data when you issue it.
#XNRFCLOUDOBSAUTO uploads the data periodically. It is disabled by default.
The upload includes the buffered events, metrics, and logs. A stored core dump is included only when core dump upload is enabled with #XNRFCLOUDOBSCOREDUMP, which is the default.
nRF Cloud receives the data. By default, the data goes to the project that nRF Cloud associates with your device. To send the data to a specific project, specify the project key of that project in the upload command. You can analyze the events, metrics, logs, and core dumps in nRF Cloud.
Note
The core dump storage holds one core dump. While a core dump is stored, subsequent crashes do not capture a new one until the stored one has been uploaded.
The core dump covers the crashes of the Serial Modem. The nRF91M1 module records a modem fault only as an event. The modem fault also drops the network connection, so the host cannot upload the event until the nRF91M1 module is connected to nRF Cloud again. If the host resets the nRF91M1 module before the upload, the event is lost.
To investigate a modem fault, collect the modem traces as described in Modem traces.
See Observability #XNRFCLOUDOBS* for the full command reference.