|
1 |
| -//! Tool to parse and dump [ITM] packets |
| 1 | +//! A library and tool (`itmdump`) to parse and dump ARM ITM packets. |
2 | 2 | //!
|
3 |
| -//! [ITM]: http://infocenter.arm.com/help/topic/com.arm.doc.ddi0314h/Chdbicbg.html |
| 3 | +//! ## Usage |
4 | 4 | //!
|
5 |
| -//! Right now, this tool only handles instrumentation packets from the stimulus |
6 |
| -//! port 0. |
| 5 | +//! ``` text |
| 6 | +//! itmdump (de13e34 2017-12-19) |
| 7 | +//! |
| 8 | +//! Reads data from an ARM CPU ITM and decodes it. |
| 9 | +//! |
| 10 | +//! Input is from an existing file (or named pipe) at a supplied path, or else from standard input. |
| 11 | +//! |
| 12 | +//! USAGE: |
| 13 | +//! itmdump [FLAGS] [OPTIONS] |
| 14 | +//! |
| 15 | +//! FLAGS: |
| 16 | +//! -F, --follow Keep the file open after reading through it and append new output as it is written. Like `tail -f'. |
| 17 | +//! -h, --help Prints help information |
| 18 | +//! -V, --version Prints version information |
| 19 | +//! |
| 20 | +//! OPTIONS: |
| 21 | +//! -f, --file <file> Path to file (or named pipe) to read from |
| 22 | +//! -s, --stimulus <port> Stimulus port to extract ITM data for. [default: 0] |
| 23 | +//! ``` |
| 24 | +//! |
| 25 | +//! ### Example: reading from saved ITM data in a file |
| 26 | +//! ``` text |
| 27 | +//! $ itmdump -f /tmp/itm.dump |
| 28 | +//! PANIC at 'Hello, world!', examples/panic.rs:13 |
| 29 | +//! ``` |
7 | 30 | //!
|
8 |
| -//! # Usage |
| 31 | +//! ### Example: reading from OpenOCD via a named pipe |
| 32 | +//! |
| 33 | +//! [OpenOCD][openocd home] is an open-source tool to debug and flash |
| 34 | +//! microcontrollers. |
| 35 | +//! |
| 36 | +//! Reading via a named pipe works well on POSIX machines; e.g. Linux |
| 37 | +//! or macOS, but not Windows. |
9 | 38 | //!
|
10 | 39 | //! ``` text
|
11 |
| -//! $ itmdump /tmp/itm.fifo |
| 40 | +//! $ mkfifo /tmp/itm.fifo |
| 41 | +//! $ itmdump -f /tmp/itm.fifo |
12 | 42 | //! ```
|
13 | 43 | //!
|
14 |
| -//! This will create a named pipe: `/tmp/itm.fifo`. Another application, e.g. |
15 |
| -//! OpenOCD, will have to be connected (open+write) to this pipe. Here's an |
16 |
| -//! example command for OpenOCD+GDB that does that. (But |
17 |
| -//! [read their documentation!]). |
| 44 | +//! This will create a named pipe: `/tmp/itm.fifo`. Another |
| 45 | +//! application, e.g. OpenOCD, will have to connect to this pipe and |
| 46 | +//! write to it. Here's an example command for OpenOCD |
| 47 | +//! + GDB that does that. ([OpenOCD documentation on ITM and |
| 48 | +//! TPIU][openocd v7m]). |
18 | 49 | //!
|
19 |
| -//! [read their documentation!]: http://openocd.org/doc/html/Architecture-and-Core-Commands.html |
| 50 | +//! [openocd home]: http://openocd.org/ |
| 51 | +//! [openocd v7m]: http://openocd.org/doc/html/Architecture-and-Core-Commands.html#ARMv7_002dM-specific-commands |
20 | 52 | //!
|
21 | 53 | //! ``` text
|
22 | 54 | //! (gdb) monitor tpiu config internal /tmp/itm.fifo uart off 8000000
|
|
29 | 61 | //! PANIC at 'Hello, world!', examples/panic.rs:13
|
30 | 62 | //! ```
|
31 | 63 | //!
|
| 64 | +//! ### Example: monitoring a file |
| 65 | +//! |
| 66 | +//! `itmdump` can monitor a file and dump new ITM data written to it |
| 67 | +//! (similar to `tail -f`). |
| 68 | +//! |
| 69 | +//! This may be useful on Windows especially where POSIX named pipes |
| 70 | +//! are not available. Just let OpenOCD capture to a file and monitor |
| 71 | +//! it with `itmdump`. |
| 72 | +//! |
| 73 | +//! ``` text |
| 74 | +//! $ itmdump -f /tmp/itm.live -F |
| 75 | +//! PANIC at 'Hello, world!', examples/panic.rs:13 |
| 76 | +//! ``` |
| 77 | +//! |
32 | 78 | //! # References
|
33 | 79 | //!
|
34 | 80 | //! - ARMv7-M Architecture Reference Manual - Appendix D4.2 Packet descriptions
|
| 81 | +//! |
| 82 | +//! Available to download [as a PDF][ARMv7-m] |
| 83 | +//! after a free registration. |
| 84 | +//! [ARMv7-m]: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0403e.b/index.html |
| 85 | +//! |
| 86 | +//! - [ARM CoreSight Technical Reference Manual section on ITM][CoreSight ITM] |
| 87 | +//! [CoreSight ITM]: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0314h/CAAGGCDH.html |
0 commit comments