diff --git a/tools/Cargo.lock b/tools/Cargo.lock index c2b3b84..9d6fbe9 100644 --- a/tools/Cargo.lock +++ b/tools/Cargo.lock @@ -169,7 +169,6 @@ dependencies = [ "probe-rs", "probe-rs-rtt", "rustc-demangle", - "thiserror", "xmas-elf", ] diff --git a/tools/dk-run/Cargo.toml b/tools/dk-run/Cargo.toml index 1dbdd3d..b74ed75 100644 --- a/tools/dk-run/Cargo.toml +++ b/tools/dk-run/Cargo.toml @@ -14,5 +14,4 @@ log = "0.4.8" probe-rs = "0.6.2" probe-rs-rtt = "0.1.0" rustc-demangle = "0.1.16" -xmas-elf = "0.7.0" -thiserror = "1.0.11" +xmas-elf = "0.7.0" \ No newline at end of file diff --git a/tools/dk-run/src/main.rs b/tools/dk-run/src/main.rs index 2ac912c..50ec002 100644 --- a/tools/dk-run/src/main.rs +++ b/tools/dk-run/src/main.rs @@ -13,7 +13,6 @@ use std::{ process, rc::Rc, }; -use core::fmt::Error; use anyhow::{anyhow, bail}; use arrayref::array_ref; @@ -198,7 +197,6 @@ fn notmain() -> Result { let mut rtt: Result; loop { - // TODO how do i best to this without allocating two rtts rtt = Rtt::attach_region( core.clone(), &sess, @@ -207,28 +205,23 @@ fn notmain() -> Result { // todo clean up control flow if rtt.is_ok() { - log::info!("successfully attached rtt"); + log::info!("Successfully attached RTT"); break; } num_retries -= 1; if num_retries == 0 { - // todo return last err instead break; } - log::info!("Rtt::attach_region failed. retrying."); + log::info!("Attaching RTT failed. retrying"); } - log::info!("go rtt"); - let channel = rtt - .unwrap() + .unwrap() // using ? instead wouldn't show the user any helpful error message .up_channels() .take(0) .ok_or_else(|| anyhow!("RTT up channel 0 not found"))?; - log::info!("chan"); - static CONTINUE: AtomicBool = AtomicBool::new(true); ctrlc::set_handler(|| {