Skip to content
Snippets Groups Projects
Commit 416e4898 authored by Edvin Åkerfeldt's avatar Edvin Åkerfeldt
Browse files

rtt_timing, F post sizify complete

parent 079a9e69
No related branches found
No related tags found
No related merge requests found
......@@ -6,37 +6,25 @@
#![no_std]
use cortex_m::{asm, peripheral::DWT};
use panic_rtt_target as _;
use rtt_target::{rprintln, rtt_init_print};
use panic_halt as _;
use stm32f4;
#[rtic::app(device = stm32f4)]
const APP: () = {
#[init]
fn init(mut cx: init::Context) {
rtt_init_print!();
rprintln!("init");
// Initialize (enable) the monotonic timer (CYCCNT)
cx.core.DCB.enable_trace();
cx.core.DWT.enable_cycle_counter();
rprintln!("start timed_loop");
unsafe {
cx.core.DWT.cyccnt.write(0);
}
let (start, end) = timed_loop();
rprintln!(
"start {}, end {}, diff {}",
start,
end,
end.wrapping_sub(start)
);
let (_start, _end) = timed_loop();
}
#[idle]
fn idle(_cx: idle::Context) -> ! {
rprintln!("idle");
loop {
continue;
}
......@@ -423,6 +411,12 @@ Cycle counter is at 6 cycles.
// > cargo size --example rtt_timing --release --features nightly
//
// [Your answer here]
/*
cargo size --example rtt_timing --release --features nightly
Finished release [optimized + debuginfo] target(s) in 0.03s
text data bss dec hex filename
664 0 0 664 298 rtt_timing
*/
//
// I was able to get down to:
// > cargo size --example rtt_timing --release --features nightly
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment