6 releases (breaking)

0.5.1 Dec 5, 2024
0.5.0 Nov 23, 2024
0.4.0 Sep 27, 2024
0.3.0 Mar 2, 2024
0.1.0 Feb 19, 2023

#331 in Embedded development

Download history 1420/week @ 2024-09-21 1012/week @ 2024-09-28 1421/week @ 2024-10-05 1689/week @ 2024-10-12 1504/week @ 2024-10-19 1078/week @ 2024-10-26 1422/week @ 2024-11-02 691/week @ 2024-11-09 682/week @ 2024-11-16 720/week @ 2024-11-23 1159/week @ 2024-11-30 1514/week @ 2024-12-07 1610/week @ 2024-12-14 1182/week @ 2024-12-21 883/week @ 2024-12-28 900/week @ 2025-01-04

4,861 downloads per month

MIT license

6KB
52 lines

rtt-log

Log facade implementation for the Segger RTT protocol supported by the J-Link, ST-Link and other debug probes. It is based on rtt-target.

[!NOTE]

rtt-target introduced log integration with version 0.6.1, making this crate obsolete.

Please refer to the rtt-target docs for further details.

Usage

// Init the logger with maximum level (Trace).
rtt_log::init();

// Alternatively, init the logger with specific level.
rtt_log::init_with_level(log::LevelFilter::Debug);

// Log something.
log::debug!("Application started");

Use a tool like probe-rs on the host to print the messages.

[!NOTE]

RTT uses a global symbol _SEGGER_RTT that can only appear once in a compiled binary. Therefore, if you want to use functions from rtt-target directly, import them from rtt-log instead of adding rtt-target as a separate dependency. Otherwise, a linker error about duplicate symbols will occur.

use rtt_log::rtt_target::rprintln;

rprintln!("Hello, world!");

License

Published under the MIT license.

Author: Oliver Rockstedt info@sourcebox.de

Dependencies

~1.5MB
~22K SLoC