Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SWD Analyzer plugin improvement #6

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

MarianSavchuk
Copy link

This pull request incorporates changes from #4 and additionally enables the decoding of SWD data and control sequences captured by waveforms, per ARM ADIv5, ADIv5.2, and ADIv6.

A brief list of improvements:

  • List of available SWD control sequence elements that can be detected:
    • Line reset ( at least 50 SWCLKTCK cycles with SWDIOTMS HIGH )
    • JTAG-to-SWD (Legacy)
    • SWD-to-JTAG (Legacy)
    • IDLE cycles
    • DS Pre-Selection Alert (at least 8 SWCLKTCK cycles with SWDIOTMS HIGH)
    • DS Selection Alert
    • DS Pre Activation Code
    • JTAG-Test-Logic-Reset (at least 5 SWCLKTCK cycles with SWDIOTMS HIGH)
    • DS-to-JTAG (activation code)
    • JTAG-to-DS
    • DS-to-SWD (activation code)
    • SWD-to-DS
  • Introduced current protocol (SWD/JTAG/DS) state machine
  • The number of turnaround cycles is set per DLCR register read/write operation
  • Sticky overrun behaviour is set per CTRL/STAT.ORUNDETECT read/write operation
  • DP and AP version is detected based on the value that is read from DPIDR
  • DP and AP register values are decoded according to their version
  • Configurable initial values of:
    • Debug Protocol
    • Last sequence
    • DP Version
    • Number of turnaround cycles
    • Sticky overrun behaviour

@HexF
Copy link

HexF commented Feb 6, 2024

I gave this branch a bit of a test whilst debugging my SWD implementation.
A few things I note;

  • I needed to tell CMake to use C++17
  • I needed to move definitions of SEQUENCE_JTAG_SERIAL, SEQUENCE_SW_DP and SEQUENCE_JTAG_DP into a cpp file, rather than the h file they are currently in.
  • TARGETSEL isn't handled properly - it doesn't get ACK'd by the chip by design, whereas the analyzer looks for them:
    image
  • I had to modify SWDAnalyzer.cpp, GetAnalyzerName so there isn't a conflict with the inbuilt plugin (this is probably expected?)

…_DP and SEQUENCE_JTAG_DP into a .cpp; Fix ACK handling on write to TARGETSEL;
@MarianSavchuk
Copy link
Author

@HexF,
Thank you for reporting the errors you found.
They should be fixed in the latest commit.
However, the analyzer name should be modified in GetAnalyzerName to avoid conflict with the in-box SWDAnalyzer plugin.
Could you test this on your setup?
Best regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants