app: Enable UART application log by default#281
Conversation
There was a problem hiding this comment.
Pull request overview
This PR switches the Serial Modem application’s default logging backend from SEGGER RTT to UART1 (VCOM1 on nRF9151 DK), with the UART kept suspended until logs are enabled at runtime via AT#XLOG=1. It also separates UART logging from the modem trace backend so that AT#XLOG is always present, while AT#XTRACE remains opt-in via an overlay.
Changes:
- Default app logging moved to UART1 with
CONFIG_LOG_BACKEND_UART_AUTOSTART=nand runtime enable/disable viaAT#XLOG. - Modem trace backend (
AT#XTRACE) kept behindoverlay-trace-backend-uart.conf; the devicetree overlay for selecting/configuring UART1 was removed and equivalent settings were moved into board overlays. - Documentation and migration notes updated to reflect the new default logging behavior and how to re-enable RTT.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| doc/releases/migration_notes_v2.0.0.rst | Adds a required migration note about the default log backend moving to UART and runtime enable via AT#XLOG=1. |
| doc/releases/migration_notes_ncs_slm_v3.1.x.rst | Adds the same migration note for users migrating from NCS SLM v3.1.x. |
| doc/links.txt | Adds a new link target for nRF9151 anomaly 36 (used by the updated logging docs). |
| doc/app/sm_logging.rst | Updates logging documentation: UART1 default, RTT re-enable instructions, and adds anomaly note. |
| doc/app/at_trace.rst | Updates prerequisites: AT#XLOG always available; AT#XTRACE requires the Kconfig overlay only. |
| app/src/sm_trace_backend_uart.c | Refactors UART device naming/handling; removes XLOG handling from this file; adds startup suspend via SYS_INIT. |
| app/src/sm_log_uart.c | New module implementing AT#XLOG and suspending/resuming the console UART to control UART log backend at runtime. |
| app/sample.yaml | Removes the deleted trace devicetree overlay from CI build args. |
| app/prj.conf | Switches defaults to UART logging (autostart off) and disables RTT by default. |
| app/overlay-trace-backend-uart.overlay | Removed; trace backend no longer relies on this overlay for routing/configuring zephyr,console. |
| app/overlay-trace-backend-uart.conf | Now only enables the UART modem trace backend (AT#XTRACE) and forces modem trace level off at boot. |
| app/CMakeLists.txt | Adds the new sm_log_uart.c source file to the build. |
| app/boards/thingy91x_nrf9151_ns.overlay | Routes zephyr,console to uart1 and configures UART1 at 1,000,000 baud. |
| app/boards/nrf9151dk_nrf9151_ns.overlay | Routes zephyr,console to uart1 and configures UART1 at 1,000,000 baud. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (!IS_ENABLED(CONFIG_LOG_BACKEND_UART) || | ||
| !IS_ENABLED(CONFIG_LOG_BACKEND_UART_AUTOSTART)) { | ||
| /* Start with UART log backend disabled. */ | ||
| if (uart_suspend()) { | ||
| LOG_ERR("Failed to suspend UART log backend"); | ||
| sm_init_failed = true; | ||
| return -EFAULT; |
There was a problem hiding this comment.
This is intended. If customer changes to RTT-traces, they do not need to disable the UART from the DTS, although they are free to do so.
d5a80be to
975e135
Compare
975e135 to
942842b
Compare
942842b to
dc24e04
Compare
| `nRF9151 anomaly 36`_ causes debug port to be locked when the application reaches low power state (<3 uA current consumption). | ||
| This takes place when DTR is deasserted and RTT client, such as J-Link RTT Viewer, is not connected. | ||
| Since the RTT backend relies on the debug port, the RTT client must be connected before the application enters low power state to avoid this issue. |
There was a problem hiding this comment.
| `nRF9151 anomaly 36`_ causes debug port to be locked when the application reaches low power state (<3 uA current consumption). | |
| This takes place when DTR is deasserted and RTT client, such as J-Link RTT Viewer, is not connected. | |
| Since the RTT backend relies on the debug port, the RTT client must be connected before the application enters low power state to avoid this issue. | |
| `nRF9151 anomaly 36`_ locks the debug port when the application reaches a low power state (<3 uA current consumption). | |
| This takes place when DTR is deasserted and the RTT client, such as J-Link RTT Viewer, is not connected. | |
| Since the RTT backend relies on the debug port, the RTT client must be connected before the application enters a low power state to avoid this issue. |
- Application logs are by default going to UART1, when the AT#XLOG=1 is given. - RTT application logs are disabled by default, but can be enabled in prj.conf if required. - UART1 is enabled by default, but suspended in startup. - overlay-trace-backend-uart.conf only includes AT#XTRACE. - overlay-trace-backend-uart.overlay is removed. Signed-off-by: Markus Lassila <markus.lassila@nordicsemi.no>
dc24e04 to
ca8639a
Compare
Jira: SM-296, SM-332