Skip to content

[Feature Request]: Prototype new trace related debug sequences in pyOCD #968

Closed

Description

@jreineckearm

Description

First actions to drive forward a prototype of wider trace support in pyOCD. Current proposal is based on deferring trace data path and sink configuration to CMSIS debug sequences. And for time being running GDB scripts to set up trace sources in the CPUs.

This includes reusing existing TraceStart and TraceStop sequences for trace setup and teardown including CoreSight trace components. And support for new TraceCapture and TraceFlush sequences to start/complete a new capture run.

  • Must
    • [Bug]: pyOCD exits with error if additional access port is added to *.cbuild-run.yml #972
    • Ability to enable trace without pyOCD-built-in configuration. Based on minimal subset of options proposed here. Critical bit is the mode: node which selects between off and two possible output modes. (TM: 14/08/2026)
    • Add TraceCapture sequence. For the time being called (TM: 14/08/2026)
      • right before setting CPUs run/step in CI mode.
      • right before setting a CPU with client connection running/stepping while all other are halted in interactive mode. (TM: 14/08/2026)
    • Add TraceFlush sequence. For the time being called right after a CPU run/step stopped. (TM: 14/08/2026)
      • right before closing down the target connection in CI mode and in interactive mode.
      • right after the last running CPU with client connection halted in interactive mode. (TM: 14/08/2026)
    • Add support for __traceclockin and __traceclockout debug access variables. See Trace configuration updates Open-CMSIS-Pack-Spec#395
      • A first implementation just passes through user settings. A later implementation should attempt an auto-detection if __traceclockout if the debug adapter technology allows.
    • Adjust the debugvars mechanisms in *.cbuild-run.yml to latest state, i.e. support device-settings with key-value pair child nodes.
    • Adjust trace: to have a list of children instead of a single child node. Format remains, for the time being only one list entry is allowed. (TM: 24/07/2026)
    • Reflect removal of port-type and addition of the type name as node, i.e. swo-uart: with an optional name. (TM: 24/07/2026)
    • Change traceSetup: under debug-sequences-conf: to trace-setup: as discussed here. (TM: 24/07/2026)
    • Default location and name for trace output files needs to change as documented here. Original file/path name conventions here are outdated and need update (will look at that ASAP). (TM: 24/07/2026)
    • Support ctrace-run as specified here. (JR - 02/10/2026: Considered done, further fixes/enhancements to be handled by individual tickets).
    • Add a monitor command to trigger reload of ctrace-run file. Changed setup gets applied when next trace capture starts. (TM: 14/08/2026)
    • Investigate why pyOCD gives the following warning/error when enabling trace for multi-core systems with a TPIU behind different access ports than the connected CPU. I see this for Renesas EK-RA8P1 and STM32H747I-DISCO. (Maybe a result of trace clock still off?)
      0000887 W SWV not initalized: Target does not have TPIU component [swv]
      
    • [Feature Request]: DWT Stream Synchronization #1149 (TM: 08/10/2026)

No longer in scope, nice to haves for future, move to separate issue and link here (JR: 02/10/2026)

  • Should

    • Add a monitor command to call any sequence from the GDB CLI. Useful to explore more use cases like in VS Code commands linked to buttons, etc. But also to test sequences under development. (JR: 09/10/2026, would be a nice to have but comes with more than just calling the sequence like setting the execution context. Scrap it until there is a stronger need again. )
  • Could

    • pyOCD allows to set debugvars through the command line: https://pyocd.io/docs/open_cmsis_pack_support.html#debug-variables. This currently is not supported for *.cbuild-run.yml. Not relevant for prototyping and initial support, but should be considered as an override like other settings where we honor the command line arguments to pyOCD. (TM: 08/10/2026)

Is this request a Security Requirement?

  • Yes

Priority

High

Related Issues (Optional)

No response

Additional Notes (Optional)

No response

Activity

  1. added
    pyOCDChange is required in shipped pyOCD variant
    on Apr 21, 2026
  2. moved this from Backlog to In progress in CMSIS Debuggeron May 25, 2026
  3. TeoMahnic commented on Sep 15, 2026

    @TeoMahnic
    Collaborator

    Addressed in pyocd/pyOCD#2030

  4. jreineckearm commented on Oct 9, 2026

    @jreineckearm
    CollaboratorAuthor

    All listed and not cancelled (striked through) requests have been fulfilled. Good to close, thanks for spending the effort on this with a sometimes still in flux specification!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

pyOCDChange is required in shipped pyOCD variant

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions