> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# SEGGER RTT

> Read RTT up channels and send to down channels through a J-Link, or capture RTT through a bench after flashing.

Use RTT when your firmware includes SEGGER RTT buffers. RTT carries text over the debug connection, so you don't need a separate UART wire. The Monitor reads RTT through a J-Link connected to your computer. Through a bench, Inlay takes a time-limited RTT capture with [probe-rs](/docs/debug-mode/probe-rs.md) after it flashes the firmware.

## Prepare J-Link RTT

1. Install the SEGGER J-Link Software and Documentation Pack on the computer running Inlay, for its operating system and architecture.
2. Connect the J-Link to that computer, power the target, and wire the probe for SWD or JTAG as the board requires.
3. Use a firmware build that initializes RTT and writes to the up channel you plan to read.

RTT ports appear in the Monitor only when the J-Link software is installed and a J-Link probe is connected.

## Connect in the Monitor

In the terminal UI, run `/monitor` to follow these steps in a browser, or use the serial sidebar. See [Use the terminal UI](/docs/debug-mode/serial-transports.md#use-the-terminal-ui).

1. Open a **Serial Monitor** tab. See [Open a Serial Monitor tab](/docs/debug-mode/serial-transports.md#open-a-serial-monitor-tab).
2. Select the port chip at the start of the toolbar, then choose an RTT entry under **Port**. The **J-Link** settings appear below the list.
3. Select **Device** and choose the exact J-Link device name, such as `nRF52840_xxAA`. A star marks devices suggested for your project.
4. Set **Interface** to **SWD** or **JTAG**, and set **Frequency** to the probe speed in MHz. The default is 4 MHz.
5. Leave **RTT block** set to **Auto-detect**. If channels aren't found, choose the current build's `.map` file there, or enter the control block's **Address** in hex.
6. Select **Connect**.

The **Port** list groups RTT entries under **RTT ↑ Up (read)** and **RTT ↓ Down (write)**:

| Port entry | What it does |
| - | - |
| **RTT ↑ All channels** | Shows every up channel in one view. Choose **Split channels** from the **⋯** (**Serial actions**) menu to show one column per channel. |
| **RTT ↑ Ch.0** | Shows one up channel. Named channels show the name in parentheses. |
| **RTT ↓ Ch.0** | Sends input to one down channel. |

Until Inlay finds the firmware's RTT channels, the list shows **J-Link RTT ↑ Ch.0** and **J-Link RTT ↓ Ch.0**. Switching between RTT channels while connected reconnects the tab automatically. The **J-Link** settings show how many J-Link probes are detected.

Use the same device and interface as any [J-Link debugger session](/docs/debug-mode/jlink.md) that's already running. If Inlay needs a different device, interface, or speed, it restarts the J-Link GDB server, which disconnects active GDB sessions. Its approval prompt warns you when a device or interface change will do this. Starting the probe can affect target state, so review the [attachment precautions](/docs/debug-mode/gdb.md#attach-to-a-running-target) before you investigate a live fault.

## Read an up channel

Up channels carry output from the target. Name the channel your firmware uses:

```text theme={"theme":"css-variables"}
Read RTT up channel 0 on nRF52840_xxAA over SWD until "boot ok" appears,
waiting at most 10 seconds. Do not reset the target. Report the captured output.
```

Replace the device and channel with yours, and check that the expected firmware text appears. A listed channel with no output can mean the firmware hasn't written to it yet.

To capture boot output, ask Inlay to reset the target through the J-Link. It resets and runs the target, then reattaches RTT. DTR and RTS resets don't apply to RTT.

If channel discovery fails, give Inlay the current build's map file that contains `_SEGGER_RTT`, or the control block address. Another firmware revision can place the buffers elsewhere. If the selected map file lacks the symbol, the **J-Link** settings show `_SEGGER_RTT not found in` followed by the file name.

## Send through a down channel

Down channels carry input to firmware that reads them. Up and down channel numbers refer to separate directions, so a logging up channel doesn't mean an input channel exists.

To send from the Monitor, use either approach:

* Select an **RTT ↓ Ch.N** port, connect, and type in the send box.
* On an up-channel tab, choose **Open down channel** from the **⋯** (**Serial actions**) menu. In the **↓ Down channel** panel, type the command and choose the channel beside the send button.

Commands sent through a connected RTT tab end with a line feed, whether you type them or Inlay sends them. If Inlay sends with no RTT tab connected, it ends the command with CR LF.

Check the firmware's response on the up channel. A successful send means the input was delivered, not that the firmware accepted the command.

## Use RTT through a bench

The Monitor's RTT ports use a J-Link connected to your own computer. For a board on a [bench](/docs/integrations/benches.md), ask Inlay for an RTT capture instead:

1. Ask Inlay to flash the firmware through that bench in the current session. Bench RTT reads from the firmware Inlay flashed, so it isn't available until then.
2. Ask for a capture with a duration or a stop string, such as `READY`. The capture ends at the time limit or when the stop string appears.

```text theme={"theme":"css-variables"}
Read RTT from the target just flashed on the selected bench for ten seconds.
Stop early if READY appears and report the captured output.
```

The board on the bench needs a known MCU, the chip name Inlay passes to probe-rs. See [probe-rs](/docs/debug-mode/probe-rs.md) for how Inlay picks the chip. The bench manages probe speed, so a probe frequency you give is ignored. A bench RTT capture doesn't reset the target.

If the target's current state is evidence, don't flash it just to enable monitoring. Keep the captured output and use an observation path that's already available until a new firmware run is appropriate.

## Reuse captured output

Ask Inlay to read the history of the active RTT tab when the event has already happened. Keep the current connection and target settings when you preserve a fault. See [Read history without reconnecting](/docs/debug-mode/serial-transports.md#read-history-without-reconnecting).

Structured event recordings need compatible trace instrumentation in the firmware. Ordinary RTT text isn't a trace format; see [Coverage and trace](/docs/debug-mode/coverage-and-trace.md#record-firmware-events).

## Troubleshoot

* **J-Link software missing:** Inlay reports that the probe is detected but the J-Link software isn't installed. Install it on the computer running Inlay, then reconnect.
* **`Flash before monitoring RTT`:** nothing was flashed to that bench in the current session. Preserve any fault evidence before you decide to program.
* **`Select a target device to use RTT`:** choose a **Device** before you connect.
* **`J-Link failed to start`:** the selected device may not match the connected hardware. Check **Device**, power, SWD/JTAG wiring, and **Frequency**.
* **No channels:** confirm the firmware initializes RTT, then select the current `.map` file or enter the control block address.
* **Channel is silent:** check the selected up channel and whether the firmware reaches its logging code.
* **Send fails:** the tab shows `[Send failed: RTT ...]` when the connection is lost. Reconnect, and confirm the firmware reads that down channel.
* **Probe is busy:** close other probe programs, or finish the active debugger or trace task before you reconnect.

See [Serial transports](/docs/debug-mode/serial-transports.md) for other logging paths and shared history.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.