-
-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request: panic-probe reset device on panic #868
Comments
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.
The text was updated successfully, but these errors were encountered: