Crates.io | rtt-target |
lib.rs | rtt-target |
version | 0.5.0 |
source | src |
created_at | 2020-04-06 12:11:46.739004 |
updated_at | 2024-01-04 11:46:10.882753 |
description | Target side implementation of the RTT (Real-Time Transfer) I/O protocol |
homepage | |
repository | https://github.com/probe-rs/rtt-target |
max_upload_size | |
id | 226874 |
size | 39,891 |
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.
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.
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!");
}
}
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.