🩺 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:
:right_arrow: Use RTT during development for all logging, debugging, and diagnostics.
:right_arrow: Reserve UART21 for runtime communication with external hardware or when the SAMD11 debugger is disconnected.

:light_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:

3 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.

2 Likes

Thank you for sharing. I want to use RTT, but each time I flash or reset the NRF54L15, I need to close and reopen the RTT console in nRF Terminal → RTT, selecting the correct module again. With JLinkRTTViewer.exe, I also need to close and reopen a session each time, which is quite inconvenient.

Have you found a solution to avoid manually reconnecting after each flash/reset?

Thank you in advance.

Hi there,

So, I’m not having that issue ? I can leave the J-Link RTT-viewer open and it reconnects each time. check you version and options. :+1:

IMO RTT is the only way to console this silicon without any work around or com port interference issues.
HTH
GL :slight_smile: PJ :v:

see this from above, LOL maybe?
" Supercharging Printf with RTT-Viewer:" on Youtube. this is the Video that is not shared now. look there. :v: its old but worthy albeit the author is DAF :grin:

I need help to understand.
If you talking to → Use RTT during development for all logging, debugging, and diagnostics.
Does it mean its connected over the xiao nrf54l15 J-Link Pins of the Backside?
or is it possible to use RTT over the USB Cable Connection?

Hi there,

YES, it uses the jlink pins.

HTH
GL :slight_smile: PJ :v:

1 Like

Hi PJ, thank you for the information.
Could you give me a short overview how exactly you connected the nRF54L15-DK to the XIAO?
I followed the documentation of the DK, therefore connected P19 of the DK to the pads 3V3, GND, RST, SWDIO and SWCLK on the XIAO. GND and SWDO_SELECT from the DK are tied to GND on the XIAO (as described in the DK guide). I supply the XIAO via USB-C. The connections look like this:

Now I would like to use RTT using the VSCode Extension (I am working on WSL). Under “Connected Devices”, my XIAO is listed as “Unknown Device” and I can’t flash it using JLink and cannot use RTT. The connections between the DK and the XIAO are quite short, I would say around an inch.

If you have done anything differently than me please let me know. Note that in the image above, P19 is arranged exactly like the physical pin header on the DK.

Hi there,

Try 2:36 timeline, watch the process.

You can verify your setup and connections by using the JLink or the Programmer, but beware what has ports open when you power on. You can’t hurt ANYTHING so don’t be afraid to try different configs. YOLO :grin: :+1:

HTH
GL :slight_smile: PJ :v:

It’s from this thread , worth a look

1 Like

Thank you for your quick response!
I will try that. I saw in the video that you have four connections from the DK to the XIAO board, as shown above I currently have five. Could you tell me what connections you have and if I should remove one?

Thank you!

After some trial and error, I am finally able to see the RTT output of the booting process. Thank you so much for your inputs, greatly appreciated!! Cheers!

1 Like