🩺 Use RTT no console required... logging, debugging, and diagnostics

:grin: So if you want an Easier way to Log, Debug or Diagnose let the Sweetness that is RTT open the WAY! :+1: a very relevant topic for anyone developing on the Xiao nRF54L15 (or any modern Nordic chip with a dedicated DAP/debug bridge).

So I see this issue on here and elsewhere , UART21 conflicts for logging and Serial port (no batteries included)…

I like the creative work-arounds some smart users came with @Toastee0 , :crossed_fingers:

If you are using the DK board then this is Awesome and it works with the SWD and Xiao connected.
Here are the points.

:brain: Why Use RTT Instead of UART for Logging on the Xiao nRF54L15

On the Xiao nRF54L15 Sense, the SAMD11 debug chip is permanently wired to the SWD interface, and this includes SEGGER RTT (Real-Time Transfer) support. This gives you a logging and console channel that runs through the debug connection, not through your firmware’s UART pins.

That means:

:white_check_mark: RTT Advantages

  • No pin conflict – UART0 (P0.21/P0.22) is free for sensors, expansion, or serial comms with other MCUs.
  • Always available during debug – even in early boot stages or low-power modes where the UART clock might be off.
  • Faster and non-blocking – RTT runs in RAM with minimal CPU overhead, transferring log data over SWD at high speed (hundreds of kB/s).
  • Zero-setup console – You just open J-Link RTT Viewer or nRF Connect for Desktop → RTT Terminal; no USB-serial adapter needed.
  • Power-friendly – When running on battery with the SAMD11 disconnected or sleeping, you can disable RTT logging completely without changing pin muxing.

:gear: How to Enable RTT in Zephyr / nRF Connect SDK

Add these lines to your prj.conf:

CONFIG_LOG=y
CONFIG_LOG_BACKEND_RTT=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_LOG_MODE_IMMEDIATE=y
CONFIG_RTT_CONSOLE=y
CONFIG_CONSOLE=y
CONFIG_PRINTK=y

Then Build as Usual :+1:
After flashing, start the console: JLinkRTTViewer.exe
or inside VS Code → “nRF Terminal → RTT”.

:warning: UART vs RTT on the Xiao nRF54L15

Feature UART (Serial on P0.21/22) RTT (via SWD + SAMD11)
Requires pins Yes (21/22) No
Works in sleep modes Limited Often yes
Bandwidth 115 k bps typical > 1 MB/s possible
Needs USB serial adapter Yes No
Debug integration Separate Built-in (J-Link)
Works when battery-only No (if SAMD11 unpowered) No (needs SWD powered)

In short:
:arrow_right: Use RTT during development for all logging, debugging, and diagnostics.
:arrow_right: Reserve UART21 for runtime communication with external hardware or when the SAMD11 debugger is disconnected.

:bulb: Pro Tip for Xiao nRF54L15 Users

If you’re building battery-powered firmware, wrap your RTT init in a debug-detect check:

if (IS_ENABLED(CONFIG_USE_SEGGER_RTT) && nrf_power_mainregstatus_get(NRF_POWER) == NRF_POWER_MAINREGSTATUS_MAINREGSTATUS_High) {
    LOG_INF("RTT active");
} else {
    LOG_INF("Battery-only mode, RTT disabled");
}

That way, you don’t hang waiting for an SWD host when the board is untethered.

Nice like using the Xiao Debugger with the built in Second Serial port on D6 & D7 :v:

:warning: The Root Problem

The Xiao nRF54L15 board definition (xiao_nrf54l15_nrf54l15_cpuapp.dts) already reserves UART0 for use by the SAMD11 debug bridge (the same chip that provides USB and SWD access).

That means:

  • UART0 (P0.21 = TX, P0.22 = RX) is claimed by the debug subsystem in the default devicetree.
  • When you try to enable it again in your overlay (for zephyr,console-uart, serial@21000, etc.), you cause duplicate node conflicts or “alias already in use” build errors.

:brick: Why RTT Solves It

RTT bypasses UART completely. It’s a memory buffer inside the MCU that the debugger reads directly over SWD — no devicetree, no pins, no clock, no serial driver.

So:

  • You avoid DTS alias conflicts (zephyr,console, uart0).
  • No pinmux collisions (P0.21/P0.22 stay free).
  • No power domain dependencies (UART clock domains can stay off).

Bottom Line, So — the issue isn’t a “bug,” it’s a board design choice.
The Seeed Xiao nRF54L15 allocates UART0 to the onboard SAMD11 debugger by default. RTT sidesteps that entirely and lets you log freely without touching the UART resources.

HTH
GL :slight_smile: PJ :v:

AS You Were!
a good video for the 10 thousand foot view, It is available on the SIL also. (no wires needed) :grin:

2 Likes

Switching to RTT would be very helpful for a lot of my use cases. Not needing UART 20, or 21 active at all keeps those precious peripheral slots available for more interesting applications.

1 Like