ARMmbed / ARMmbed/DAPLink

RFC: add an interface to support collecting ETM traces from a TPIU

Open
#781 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
2.8k
Forks
1.1k
Avg merge
3d 12h
Merged PRs (30d)
1

Description

Hi
GDB is now being extended to support using ETM traces in branch tracing. and the remote protocol is also extended accordingly. to enable PyOcd or OpenOcd to support this feature, the interface to the debugger needs to be extended, more precisely, the commands protocol over usb.
this extension is to enable
- getting the capabilities of the debugger (if it supports collecting the traces)
- getting infos about the tracing mechanism (supported port sizes, buffer size)
- start and stop collecting the traces
- get the status of traces collection
- get collected traces.
here is a proposal for the extension, a reference dummy implementation can also be provided.

- Modified: Response to DAP_Info capabilities: add 2 bits to the capabilities response to indicate if "Trace Port Analyzer" is present or not and to indicate if "TPA Streaming" is supported or not. the size can now be 1 or 2 bytes.
- New: DAP_Info ID: TPA Port Sizes to get the list of supported port sizes, and its response
- New: DAP_Info ID: TPA Trace Buffer Size to get the size of the TPA buffer used to collect the traces, and its response
see Dap_info.pdf for more details
[DAP_Info.pdf](https://github.com/ARMmbed/DAPLink/files/5989086/DAP_Info.pdf)

- New: DAP_TPA_PortSize: command to set the size of TPA port
see TAP_Port_size.pdf for more details
[TAP_Port_size.pdf](https://github.com/ARMmbed/DAPLink/files/5989178/TAP_Port_size.pdf)

- New: DAP_TPA_Transport: to select the transport used for the traces (DAP_TPA_Data or separate WinUSB endpoint)
see TPA_Transport.pdf for more details
[TPA__Transport.pdf](https://github.com/ARMmbed/DAPLink/files/5989201/TPA__Transport.pdf)

- New: DAP_TPA_Control: command to start/stop collecting traces
see TPA_control.pdf for more details
[TAP_Control.pdf](https://github.com/ARMmbed/DAPLink/files/5989210/TAP_Control.pdf)

- New: DAP_TPA_Status: get the status of traces collection.
see TPA_status.pdf for more details
[TPA__Status.pdf](https://github.com/ARMmbed/DAPLink/files/5989223/TPA__Status.pdf)

- New: DAP_TPA_Data: retreive collected ETM data.
see TPA_Data.pdf for more details
[TAP_Data.pdf](https://github.com/ARMmbed/DAPLink/files/5989235/TAP_Data.pdf)

Kind Regrads
Zied Guermazi

Contributor guide

Open the contributing guide

Research direction

Start by reading the linked DAP_Info, TPA_Port_size, TPA_Transport, TPA_Control, TPA_Status, and TPA_Data PDFs, then locate the existing USB command protocol and DAP_Info handling. Done means implementing and documenting the proposed capability, port-size, transport, control, status, and trace-data commands with compatible responses.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.