#rtt #debugging #no-std

no-std rtt-target

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

9 unstable releases

0.5.0 Jan 4, 2024
0.4.0 Mar 3, 2023
0.3.1 Apr 27, 2021
0.3.0 Nov 24, 2020
0.1.1 Apr 19, 2020

#67 in Embedded development

Download history 1738/week @ 2023-12-22 3031/week @ 2023-12-29 4061/week @ 2024-01-05 3083/week @ 2024-01-12 2857/week @ 2024-01-19 3835/week @ 2024-01-26 2747/week @ 2024-02-02 4294/week @ 2024-02-09 3363/week @ 2024-02-16 4611/week @ 2024-02-23 3990/week @ 2024-03-01 5562/week @ 2024-03-08 3920/week @ 2024-03-15 3033/week @ 2024-03-22 3305/week @ 2024-03-29 3344/week @ 2024-04-05

14,244 downloads per month
Used in 71 crates (55 directly)

MIT license

39KB
598 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

To use the global rprintln! macro, a platform-specific critical-section implementation is needed for locking.

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 critical section.

Usage

With a platform-specific critical section in use, printing is as simple as:

use rtt_target::{rtt_init_print, rprintln};

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

Development

The examples-cortex-m and panic-test crates come with build files for the venerable STM32F103C8xx by default, but can be easily adapted for any chip as they contain only minimal platform-specific runtime code to get fn main to run.

Dependencies

~35KB