2 releases

0.1.1 Apr 25, 2019
0.1.0 Feb 6, 2019

#9 in #panic-impl

Download history 3/week @ 2024-02-15 22/week @ 2024-02-22 23/week @ 2024-02-29 9/week @ 2024-03-07 4/week @ 2024-03-14

59 downloads per month
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

~1MB
~12K SLoC