#panic-handler #panic-impl #panic #ramdump

no-std panic-ramdump

Keep panic messages in the targets’ RAM

2 releases

0.1.1 Apr 25, 2019
0.1.0 Feb 6, 2019

#5 in #panic-impl


Used in stm32f072b-disco

MIT/Apache

7KB

panic-ramdump

Report panic messages to the RAM of the target

Documentation

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


lib.rs:

Writes panic messages to the beginning of RAM

This crate contains an implementation of panic_fmt that logs panic messages to the beginning of RAM, recklessly overwriting the previous contents of that area. After logging the message the panic handler goes into an infinite loop, so a debugging probe can connect and pick up the panic.

Unlike other methods this allows to discover the panic reason post-mortem by attaching a debugger probe after the device crashed.

Currently this crate was only tested on ARM Cortex-M architecture but should be easily portable to other platforms as required.

Usage

#![no_std]

extern crate panic_ramdump;

fn main() {
    panic!("FOO")
}
(gdb) x/s 0x20000000
0x20000000:	"panicked at 'FOO!', src/main.rs:6:5\n\276\244\001"

Dependencies

~605KB
~12K SLoC

\