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

Fix: native Trace/SWO support #1934

Merged
merged 48 commits into from
Sep 26, 2024
Merged

Fix: native Trace/SWO support #1934

merged 48 commits into from
Sep 26, 2024

Conversation

dragonmux
Copy link
Member

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

@dragonmux dragonmux added Bug Confirmed bug Enhancement General project improvement BMP Firmware Black Magic Probe Firmware (not PC hosted software) labels Sep 17, 2024
@dragonmux dragonmux added this to the v2.0 release milestone Sep 17, 2024
@dragonmux dragonmux force-pushed the fix/native-trace-swo-support branch 15 times, most recently from e59adfc to cabbad7 Compare September 18, 2024 00:05
@dragonmux dragonmux force-pushed the fix/native-trace-swo-support branch 9 times, most recently from acfb8a1 to 552ef3e Compare September 22, 2024 01:35
… logic out from where it shouldn't be, and fix the deinit behaviour
…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
…the top of file comments, including the docs references
Copy link
Member

@esden esden left a 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!!! :)

@esden esden merged commit 7ce749e into main Sep 26, 2024
20 of 26 checks passed
@dragonmux dragonmux deleted the fix/native-trace-swo-support branch September 26, 2024 23:20
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants