#no-std #embedded #debugging #rtt

no-std rtt-target

Target side implementation of the RTT (Real-Time Transfer) I/O protocol

7 releases

0.3.1 Apr 27, 2021
0.3.0 Nov 24, 2020
0.2.2 Aug 22, 2020
0.2.0 May 7, 2020
0.1.1 Apr 19, 2020

#718 in Embedded development

Download history 2838/week @ 2022-01-24 3083/week @ 2022-01-31 4719/week @ 2022-02-07 3819/week @ 2022-02-14 4532/week @ 2022-02-21 4157/week @ 2022-02-28 2372/week @ 2022-03-07 2375/week @ 2022-03-14 1515/week @ 2022-03-21 1692/week @ 2022-03-28 1086/week @ 2022-04-04 1280/week @ 2022-04-11 3165/week @ 2022-04-18 1644/week @ 2022-04-25 2050/week @ 2022-05-02 1143/week @ 2022-05-09

8,086 downloads per month
Used in 54 crates (41 directly)

MIT license

37KB
591 lines

rtt-target

crates.io documentation

Target side implementation of the RTT (Real-Time Transfer) I/O protocol. RTT implements input and output via a debug probe using in-memory ring buffers and polling. This enables debug logging from the microcontroller with minimal delays and no blocking, making it usable even in real-time applications where e.g. semihosting delays cannot be tolerated.

Documentation

Platform support

While this crate is platform agnostic, some platform-specific code is needed for locking if you want to use the global rprintln! macro.

If using Cortex-M or RISC-V, there is built-in support with a feature flag:

# Cargo.toml
rtt-target = { version = "x.y.z", features = ["cortex-m"] }
# or
rtt-target = { version = "x.y.z", features = ["riscv"] }

Otherwise, check the documentation for the set_print_channel_cs function.

Output directly to a channel object with write! or the binary write method does not require locking and therefore does not need any platform-specific code.

Usage

With a platform support feature, printing is as simple as:

use rtt_target::{rtt_init_print, rprintln};

fn main() {
    rtt_init_print!();
    loop {
        rprintln!("Hello, world!");
    }
}

Dependencies

~120KB