How seggermicro/rtt works
SEGGER RTT is an embedded-target library for high-performance bidirectional monitoring and interactive I/O between firmware and a host/debug probe. Firmware applications write output or formatted text into RTT up-channel ring buffers and read host input from down channels; the host/debug probe exchanges data through the shared control block. Optional toolchain syscall shims retarget standard output, and example applications demonstrate echo, menus, formatted output, and throughput measurement. The core source excerpts are partial, so links beyond the documented API and shown calls are omitted where uncertain.
Main entry points: SEGGER_RTT.c RTT Transfer Engine · SEGGER_RTT.h RTT API · SEGGER_RTT_printf.c RTT Formatter · SEGGER_RTT_Conf.h RTT Configuration
Components 17
RTT Core
- RTT API
RTT/SEGGER_RTT.h - RTT Transfer Engine
RTT/SEGGER_RTT.c - RTT Control Block
RTT/SEGGER_RTT.c - RTT Configuration
Config/SEGGER_RTT_Conf.h - Default Configuration
RTT/SEGGER_RTT_ConfDefaults.h - ARM Optimizations
RTT/SEGGER_RTT_ASM_ARMv7M.S
Formatted Output
- RTT Formatter
RTT/SEGGER_RTT_printf.c
Toolchain Retargeting
- GCC Syscalls
Syscalls/SEGGER_RTT_Syscalls_GCC.c - IAR Syscalls
Syscalls/SEGGER_RTT_Syscalls_IAR.c - Keil Syscalls
Syscalls/SEGGER_RTT_Syscalls_KEIL.c - SES Syscalls
Syscalls/SEGGER_RTT_Syscalls_SES.c
Example Apps
- Input Echo
Examples/Main_RTT_InputEchoApp.c - Interactive Menu
Examples/Main_RTT_MenuApp.c - Printf Test
Examples/Main_RTT_PrintfTest.c - Speed Test
Examples/Main_RTT_SpeedTestApp.c
Other components
- Embedded Application
- Host Debug Probe
Connections 17
- Embedded Application → RTT API: calls
- RTT API → RTT Transfer Engine: dispatches
- RTT Transfer Engine → RTT Control Block: reads/writes
- Host Debug Probe → RTT Control Block: exchanges data
- RTT Configuration → RTT Transfer Engine: configures
- Default Configuration → RTT Transfer Engine: defaults
- ARM Optimizations → RTT Transfer Engine: optional implementation
- Embedded Application → RTT Formatter: formats output
- RTT Formatter → RTT Transfer Engine: writes via RTT
- GCC Syscalls → RTT Transfer Engine: retargets writes
- IAR Syscalls → RTT Transfer Engine: retargets writes
- Keil Syscalls → RTT Transfer Engine: retargets writes
- SES Syscalls → RTT Transfer Engine: retargets output
- Input Echo → RTT API: uses RTT
- Interactive Menu → RTT API: uses RTT
- Printf Test → RTT Formatter: tests formatting
- Speed Test → RTT API: measures transfer