probe-rs/rtt-target

asm breakpoint style handler

jacobrosenthal opened this issue · 3 comments

I'm sure youve seen probe-run https://ferrous-systems.com/blog/probe-run/ utilizing this crate heavily. In all their docs they're using a locally defined panic_handler which simply rprintln and asm breaks.

// if an panic happens, print it out and signal probe-run to exit
#[panic_handler]
fn panic(info: &core::panic::PanicInfo) -> ! {
    rprintln!("{}", info);
    loop {
        cortex_m::asm::bkpt() // halt = exit probe-run
    }
}

I could publish a separate crate dependant on this one, but they could go out of sync. Any thoughts on keeping this internally?

It looks like their "defmt" system which will probably be used a lot has their own RTT implementation which is incompatible with rtt-target. If this is still useful it could be added - do you think it should be a separate crate (kinda heavy) or a feature? I'm not sure if it's a good idea to bkpt unless we know something will handle it.

Seem fine, user brought it in after all. Same as halting.
I agree they'll use defmt but for simple use cases I find it a bit heavy to configure. Not to mention it's not released. I'll be using rtt-target and probe-run for non space constrained examples personally.

Looks like theyre preparing to have a feature on probe-rs for this, since thats the other best place for that to live, ill close this for now
knurling-rs/probe-run@ef45f6f