Fix: ADIv5 debug bringup reliability #1577
Merged
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
During the process of building target support for the Ambiq Apollo 3, Sid wound up hitting and issue where the debug reset code in the ADIv5 implementation would cause the target to quit talking SWD or JTAG till power cycled, preventing scan from working.
After working with zyp, mubes and Sid and reading the ADIv5 spec closely, we have come to the conclusion that we can get the effect of the reset sequence logic by instead powering down the debug engine on the target, then powering it back up. This is guaranteed by the spec for targets that actually implement power control on the APs and debug bus to cause the APs and debug bus to come back up via a reset, getting the same net effect as the prior logic.
This has been tested on a couple of different targets including the STM32F411, LPC4370 and Apollo 3, and appears to be reliable, with the AP bringup code mopping up the only potential stale values this can cause for targets that don't implement power control.
Your checklist for this pull request
make PROBE_HOST=native
)make PROBE_HOST=hosted
)Closing issues