2 releases
0.1.1 | Apr 25, 2019 |
---|---|
0.1.0 | Feb 6, 2019 |
#7 in #panic-impl
Used in stm32f072b-disco
7KB
panic-ramdump
Report panic messages to the RAM of the target
Documentation
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
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