Skip to main content
Use a J-Trace to see which instructions an Arm target executed, or which functions and source lines a test exercised. The target must support ETM. A plain J-Link handles debugging and RTT, but it can’t capture ETM trace.

Prepare the connection

  1. Install the SEGGER J-Link Software and Documentation Pack on the computer running Embedder.
  2. Connect the J-Trace to the target with the fine-pitch CoreSight-20 trace cable. The wide 0.1-inch debug ribbon carries no trace signals.
  3. Confirm the board routes the target’s ETM trace pins to that connector, and that the target drives TRACECLK.
  4. Find the exact SEGGER device name for your MCU, such as STM32F407VE.
  5. Build the firmware and keep the ELF of the build you’ll run.

Tell Embedder the device and clock

Every capture needs the SEGGER device name. The CPU clock is optional: it gives the instruction timeline an estimated time axis. Where Embedder reads them depends on how you start the capture:
  • Select the J-Link Device in a Serial Monitor tab’s RTT settings or in the Trace tab’s source settings. Captures from the Monitor connect over the Interface selected with it, SWD unless you choose JTAG.
  • Target MCU must hold one exact SEGGER device name. Don’t guess it. A wrong name makes the connection fail.
  • The time axis is an estimate based on instruction count, not a measurement.
Use the ELF of the build that’s running. Embedder resolves addresses as they arrive, so attaching an ELF afterward can’t fix unresolved rows. If you don’t choose one, a bounded capture or coverage run uses an ELF it finds in the project, so name the ELF when the project builds more than one.

Capture instructions and coverage

Captures and coverage runs reset the target, run it for the set time, and then halt it. They also take the probe from RTT and any running debug server, which disconnects GDB sessions. Save paused-state evidence before you start one.
You can start each workflow from the Monitor or from chat: For example:
A bounded capture from the Trace tab keeps the most recent 65,536 instructions at most. Longer runs execute more instructions than that window holds. Coverage counts every instruction in the run, so coverage stays complete even when the trace window holds only the tail. See Coverage and trace for the step-by-step workflows, settings, and how to read the results.

Choose a longer stream carefully

A streamed capture starts at reset and keeps a rolling window of recent instructions, so it can include startup that a bounded capture misses. To read the trace, it halts the target between short slices, and the firmware runs far slower than normal. Interrupts, timeouts, and handshakes can behave differently. Use a logic analyzer, oscilloscope, or target timer for timing measurements. Instruction order and estimated time axes don’t establish elapsed time.

Script a custom capture

If the built-in captures don’t fit your test, ask Embedder to write a hardware script. Scripts can import the jtrace Python package for capture, coverage, and direct target control. Embedder makes it available to hardware scripts automatically, so there’s nothing to install.
.embedder/hardware/coverage_check.py
Reports and captures from scripts appear in the Coverage and Trace tabs.
  • Run scripts through Embedder’s hardware-script runner. It holds the probe for the script so other hardware workflows don’t compete for it.
  • When a script controls the target directly, open the probe with with JLink(...) so it closes even when the script fails. A probe left open blocks later flashing, debugging, and RTT until it’s closed.

Troubleshoot

  • SEGGER J-Link software not found: install the J-Link Software and Documentation Pack, then try again.
  • No SEGGER probe detected: connect the J-Trace over the fine-pitch CoreSight-20 cable.
  • The message says a plain J-Link can’t stream trace: only a J-Link is connected. Use GDB or RTT with it, or connect a J-Trace for ETM.
  • No target device configured: select the J-Link Device in a Serial Monitor tab, or add Target MCU = <name> to EMBEDDER.md.
  • No .elf firmware binary found in the project: build the firmware, or name the ELF in your request.
  • Trace start failed, or no instructions: check the trace cable, target power, the device name, routed trace pins, and TRACECLK.
  • Function or source names are wrong: capture again with the ELF of the build that’s running.
  • Behavior changes during a capture: a streamed capture slows the target. Compare with a bounded capture or an external measurement.
  • Hardware is busy in another workflow.: Embedder or a hardware script holds the probe. Wait for it to finish or stop it.
  • The probe stays busy: stop active captures and scripts, and disconnect unused debugger sessions.
Last modified on November 13, 2026