Repository navigation
[Feature Request]: Prototype new trace related debug sequences in pyOCD #968
Copy link
Copy link
Closed
Labels
pyOCDChange is required in shipped pyOCD variantChange is required in shipped pyOCD variant
Description
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 betweenoffand two possible output modes. (TM: 14/08/2026) - Add
TraceCapturesequence. 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
TraceFlushsequence. 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
__traceclockinand__traceclockoutdebug 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
__traceclockoutif the debug adapter technology allows.
- A first implementation just passes through user settings. A later implementation should attempt an auto-detection if
- Adjust the debugvars mechanisms in
*.cbuild-run.ymlto latest state, i.e. supportdevice-settingswith 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-typeand addition of the type name as node, i.e.swo-uart:with an optional name. (TM: 24/07/2026) - Change
traceSetup:underdebug-sequences-conf:totrace-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-runas 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)
- Tested with https://github.com/pyocd/pyOCD/tree/feature/trace at pyocd/pyOCD@da26e7f : The changes are correctly applied. But opposed to what the specification says, the data captured after the reload is appended to the raw file instead of replacing it. Also see "Interactive Debug Workflow" under https://open-cmsis-pack.github.io/cmsis-toolbox/Experimental-Features/#tools-and-extensions . Verified by deleting the CSV file and rerunning ctrace on such raw capture file. (JR: 21/08/2026) Can confirm this is working now as expected (JR: 02/10/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(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. )monitorcommand 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.
-
-
Could
-
pyOCD allows to set(TM: 08/10/2026)debugvarsthrough 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.
-
Is this request a Security Requirement?
- Yes
Priority
High
Related Issues (Optional)
No response
Additional Notes (Optional)
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
pyOCDChange is required in shipped pyOCD variantChange is required in shipped pyOCD variant
Type
Projects
- StatusShow more project fieldsDone
Activity
TeoMahnic commentedon Sep 15, 2026
Addressed in pyocd/pyOCD#2030
jreineckearm commentedon Oct 9, 2026
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!