#arm #cortex-m #stm32 #log


Logging facilities for Cortex-M processors

7 releases

0.3.3 Sep 8, 2018
0.3.2 Sep 7, 2018
0.3.0 Jul 5, 2018
0.2.0 May 17, 2018
0.1.1 May 15, 2018

#89 in Embedded development

Download history 15/week @ 2018-08-08 20/week @ 2018-08-15 9/week @ 2018-08-22 1/week @ 2018-09-05 42/week @ 2018-09-12 3/week @ 2018-09-19 13/week @ 2018-09-26 16/week @ 2018-10-03 6/week @ 2018-10-10 51/week @ 2018-10-17 11/week @ 2018-10-24

55 downloads per month
Used in 1 crate


274 lines


Build Status Crates.io Documentation dependency status

Logging facilities for Cortex-M processors

Available features

  • log-integration - Enables log integration
  • semihosting - Enables facilities for cortex-m-semihosting.
  • itm - Enables ITM destination for logging (not available on Cortex-M0 microcontrollers)


Logging facilities for Cortex-M processors


The crate provides following destinations for writes:

  • Dummy - noop destination that performs no writes. Useful for release mode
  • Itm - Uses Cortex-M Itm to send output. Note that it is available only on ARMv7-M and newer
  • Semihosting - Uses Cortex-M Semihosting to send output.

All destinations implements fmt::Write to provide simple and generic interface


Each destination is provided with corresponding Printer. In addition to providing generic interface it also allows to configure Interrupt mode for all prints. See.


The crate provide primitieve macros that are enabled only in debug release. Controlled by debug_assertions attribute

#[macro_use(print, println, d_print, d_println)]
extern crate cortex_m_log;
extern crate log;

use cortex_m_log::printer::Dummy;

fn main() {
    let mut log = Dummy;
    println!(log, "Some print with newline!");
    //Debug version of print that resolves into nothing in release mode
    //Note that you must import print macro for it to work
    d_print!(log, "Print stuff: {}", "stuff");
    //Note that you must import println macro for it to work
    d_println!(log, "Print stuff: {} and also newline", "stuff");