itm-parser-0.1.2 is not a library.
ITM Parser
itm-parser
is a command-line tool for parsing and formatting ITM (Instrumentation Trace Macrocell) output. It simplifies debugging by converting raw ITM messages into human-readable ASCII text, working seamlessly with probe-rs
in the background.
Note:
itm-parser
internally usesprobe-rs
. Ensureprobe-rs
is installed before using this tool.
Features
- Parses ITM Instrumentation packets (e.g.,
Ok(Instrumentation { port: 0, payload: [...] })
). - Decodes payloads into readable ASCII text.
- Supports newline characters (
\n
) in payloads for proper log message formatting. - Fully integrates with
probe-rs
for ITM communication.
Installation
Step 1: Install probe-rs
itm-parser
relies on probe-rs
to interact with your embedded device. Install probe-rs
using Cargo:
Step 2: Install itm-parser
Once probe-rs
is installed, install itm-parser
:
Usage
- Run the
itm-parser
command with required arguments. Internally, it uses probe-rs itm swo to interact with your embedded device.
Command Syntax
Arguments
- --chip (required): The target chip identifier (e.g., STM32F303CC).
- --probe VID:PID (optional): The VID:PID of the debug probe to use (e.g., 0483:374b). If omitted, the default probe will be used.
- --connect-under-reset flag tells the debugger (in this case, probe-rs) to hold the target MCU in reset while it is establishing a debug connection. So you have to press the reset button of the board to run the code.
- (required): Duration of the trace in milliseconds.
- (required): Clock speed feeding the TPIU/SWO module in Hz.
- (required): Desired baud rate for SWO output.
Example
Output
If the raw ITM packets contain:
Ok(Instrumentation { port: 0, payload: [72, 101, 108, 108, 111, 10] })
Ok(Instrumentation { port: 0, payload: [87, 111, 114, 108, 100, 10] })
itm-parser
will decode and display:
Hello
World