From e8ef0df2c8beebec5b8e7923c668944d2476f61c Mon Sep 17 00:00:00 2001 From: Per Lindgren <per.lindgren@ltu.se> Date: Sun, 4 Feb 2018 01:18:41 +0100 Subject: [PATCH] debug example --- examples/hello_debug.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 examples/hello_debug.rs diff --git a/examples/hello_debug.rs b/examples/hello_debug.rs new file mode 100644 index 0000000..12b07ce --- /dev/null +++ b/examples/hello_debug.rs @@ -0,0 +1,19 @@ +//! Using cortex-m-debug, for simple tracing + +#![deny(unsafe_code)] +#![deny(warnings)] +#![no_std] + +extern crate stm32f4x_hal; + +// Convenient tracing over semihosting and ITM +#[macro_use] +extern crate cortex_m_debug; + +fn main() { + ip!("ITM: Hello "); + ipln!("World! for the {} time", 50); + + sp!("Semihosting: Hello "); + spln!("World! for the {} time", 50); +} -- GitLab