#no-std #embedded #debugging #rtt

no-std rtt-target

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

8 releases

0.4.0 Mar 3, 2023
0.3.1 Apr 27, 2021
0.3.0 Nov 24, 2020
0.2.2 Aug 22, 2020
0.1.1 Apr 19, 2020

#59 in Embedded development

Download history 2214/week @ 2023-02-05 1520/week @ 2023-02-12 3758/week @ 2023-02-19 1779/week @ 2023-02-26 1864/week @ 2023-03-05 1566/week @ 2023-03-12 1928/week @ 2023-03-19 2611/week @ 2023-03-26 1566/week @ 2023-04-02 2455/week @ 2023-04-09 2239/week @ 2023-04-16 1182/week @ 2023-04-23 2498/week @ 2023-04-30 1759/week @ 2023-05-07 1389/week @ 2023-05-14 993/week @ 2023-05-21

6,710 downloads per month
Used in 63 crates (47 directly)

MIT license

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

~31KB