-
-
Notifications
You must be signed in to change notification settings - Fork 792
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: STM32 DBGMCU attach/detach behaviour #2013
Merged
Merged
+192
−161
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
…age copy of the register state so we're insensitive to the debugged firmware changing the state at runtime
…age copy of the register state so we're insensitive to the debugged firmware changing the state at runtime
…nction, restructuring the probe vs attach code slightly
…age copy of the register state so we're insensitive to the debugged firmware changing the state at runtime
…age copy of the register state so we're insensitive to the debugged firmware changing the state at runtime
…age copy of the register state so we're insensitive to the debugged firmware changing the state at runtime
…age copy of the register state so we're insensitive to the debugged firmware changing the state at runtime
…age copy of the register state so we're insensitive to the debugged firmware changing the state at runtime
721dabf
to
85fa0db
Compare
…dic " part of the part strings as other target implementations do not include the MFR in the identifier for space reasons
… solve the out of Flash space problem
Loading status checks…
b6ab21a
to
b10a119
Compare
Loading status checks…
…to solve the out of Flash space problem
esden
approved these changes
Dec 11, 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.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 #1882 we introduced control of the WDT halt state to prevent debug sessions getting clobbered by them while the part is intentionally halted. In that PR we stored the state of the DBGMCU on attach, and restored it on detach - which on its face seems like a reasonable heuristic, however.. we worried at the time and have since had that fear confirmed that this doesn't work well because both the user code and the debugger can change the state of the DBGMCU register in question itself to do things like enabling tracing, and users want to be able to detach from the target to leave tracing running.
In the scenario outlined above, however, BMD will disable tracing by restoring the pre-image of the DBGMCU control register, and undo any other freeze configuration by restoring the freeze register for the WDTs and this breaks setups and re-disables tracing. This PR fixes that by always doing a RMW cycle on the registers regardless and dropping the stored state component.
We also include a small fix for some Flash size issues to restore the build on the swlink platform.
Your checklist for this pull request
Closing issues