#parse #tool #ARM #ITM

bin+lib itm

Tool to parse and dump ITM packets

6 releases

0.3.1 Jul 5, 2018
0.3.0 Jul 5, 2018
0.2.1 Feb 25, 2018
0.2.0 Jan 11, 2018
0.1.1 Oct 20, 2016

#38 in Embedded development

Download history 8/week @ 2018-09-13 26/week @ 2018-09-20 25/week @ 2018-09-27 30/week @ 2018-10-04 18/week @ 2018-10-11 72/week @ 2018-10-18 19/week @ 2018-10-25 20/week @ 2018-11-01 89/week @ 2018-11-08 43/week @ 2018-11-15 25/week @ 2018-11-22 55/week @ 2018-11-29 36/week @ 2018-12-06

129 downloads per month

MIT/Apache

22KB
487 lines

crates.io crates.io

itm

A Rust crate and tool itmdump to parse and dump ARM ITM packets.

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:

A library and tool (itmdump) to parse and dump ARM ITM packets.

Usage

itmdump  (de13e34 2017-12-19)

Reads data from an ARM CPU ITM and decodes it.

Input is from an existing file (or named pipe) at a supplied path, or else from standard input.

USAGE:
    itmdump [FLAGS] [OPTIONS]

FLAGS:
    -F, --follow     Keep the file open after reading through it and append new output as it is written. Like `tail -f'.
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -f, --file         Path to file (or named pipe) to read from
    -s, --stimulus     Stimulus port to extract ITM data for. [default: 0]

Example: reading from saved ITM data in a file

$ itmdump -f /tmp/itm.dump
PANIC at 'Hello, world!', examples/panic.rs:13

Example: reading from OpenOCD via a named pipe

OpenOCD is an open-source tool to debug and flash microcontrollers.

Reading via a named pipe works well on POSIX machines; e.g. Linux or macOS, but not Windows.

$ mkfifo /tmp/itm.fifo
$ itmdump -f /tmp/itm.fifo

This will create a named pipe: /tmp/itm.fifo. Another application, e.g. OpenOCD, will have to connect to this pipe and write to it. Here's an example command for OpenOCD + GDB that does that. (OpenOCD documentation on ITM and TPIU).

(gdb) monitor tpiu config internal /tmp/itm.fifo uart off 8000000

itmdump will read from the pipe, parse the packets and write the payload to stdout:

PANIC at 'Hello, world!', examples/panic.rs:13

Example: monitoring a file

itmdump can monitor a file and dump new ITM data written to it (similar to tail -f).

This may be useful on Windows especially where POSIX named pipes are not available. Just let OpenOCD capture to a file and monitor it with itmdump.

$ itmdump -f /tmp/itm.live -F
PANIC at 'Hello, world!', examples/panic.rs:13

References

  • ARMv7-M Architecture Reference Manual - Appendix D4.2 Packet descriptions

Available to download as a PDF after a free registration.

Dependencies

~4.5MB
~82K SLoC

  • build build.rs
  • dev tempdir 0.3.5