-
-
Notifications
You must be signed in to change notification settings - Fork 777
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
Fix: native Trace/SWO support #1934
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dragonmux
added
Bug
Confirmed bug
Enhancement
General project improvement
BMP Firmware
Black Magic Probe Firmware (not PC hosted software)
labels
Sep 17, 2024
dragonmux
force-pushed
the
fix/native-trace-swo-support
branch
15 times, most recently
from
September 18, 2024 00:05
e59adfc
to
cabbad7
Compare
dragonmux
force-pushed
the
fix/native-trace-swo-support
branch
9 times, most recently
from
September 22, 2024 01:35
acfb8a1
to
552ef3e
Compare
…ut to reduce duplication
… logic out from where it shouldn't be, and fix the deinit behaviour
…so there's less to be dragged around
…he pin configured, which is wrong for platforms that share their SWO pin with TDO
…ed buffer to handle the data with DMA direct to that surge buffer, and no intermediary buffers
…der support even on platforms where it should not
…annel 2, adjust for that
…el 2, adjust for that
…the top of file comments, including the docs references
dragonmux
force-pushed
the
fix/native-trace-swo-support
branch
from
September 25, 2024 05:55
98056c6
to
7ce749e
Compare
esden
approved these changes
Sep 26, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks great! Thank you for getting it all to work!!! :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
BMP Firmware
Black Magic Probe Firmware (not PC hosted software)
Bug
Confirmed bug
Enhancement
General project improvement
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Detailed description
In this PR we address the very sorry state of SWO across the firmware, but with a particular focus on getting the native BMP platform fixed so the v2.3 hardware (HW6) functions at all.
This is split into four distinct phases: code nomenclature corrections; rewriting the Manchester mode support, fixing issues with handling for the GD32F103 and documenting it; file nomenclature corrections; and finally but not least, sorting the UART mode support out as well so both can be run in a single firmware image ("switchable SWO"), sorting out the various other platforms in the process.
Buffering and buffer sizing may still be an issue that needs more work, however this is all working flawlessly on both STM32F103 and GD32F103 native hardware in both modes at up to 115200 baud (higher probably achievable, but we haven't tested that yet) with only very minor data loss from the Manchester mode support when the link is at 100% usage at that speed.
Documentation on the website will need updating after this PR merges to document the multi-mode (switchable) SWO command.
NB: While the SWO pin is referred to as TRACESWO in the CoreSight Components TRM (DDI0314 ver. H) in one spot, everywhere else refers to it as SWO, and the debug sections of the Architecture Reference Manuals refer to it as SWO as well, as do vendors, so the project is choosing to stick with the SWO nomenclature only in favour of no ambiguity and to keep this support distinct from support for the parallel Trace interface which is a different wire-level interface with different transmission encoding. Both emanate from the same component in the target (the TPIU), but this distinction feels important to keep things as straightforward for users as possible.
Your checklist for this pull request
Closing issues
Fixes #1934