Open Gibbz opened 1 month ago
It's supposed to reset the device when there is a panic.
Is this documented behavior of panic-probe? I don't recall that it is supposed to do that.
But I think it would be possible to add a cargo feature which does configure it to do a reset.
Ah! Okay maybe it's not. I was trying to use a crate to do this and it was giving me a warning saying panic probe does this.
I've done it manually for now. But I'll leave this open as a feature request then.
Is it possible you could share your workaround? As a reference for others and maybe an implementation
I used the following
use core::panic::PanicInfo;
#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
cortex_m::interrupt::disable();
defmt::error!("Panicked: {}", defmt::Display2Format(info));
//panic_persist::report_panic_info(info);
for _ in 0..2_000_000 { // delay before reset
nop()
}
cortex_m::peripheral::SCB::sys_reset();
}
I'm using panic probe with embassy rust. It's supposed to reset the device when there is a panic. The logging part is working fine, however the device stays stuck after the log. There is no reset.
Is there some extra setting required to cause it to reset after the log?
Edit: make this a feature request or it can be closed.