SWD: Remove excessive line resets.

This commit is contained in:
Uwe Bonnes 2021-10-23 20:02:19 +02:00
parent e7e1bfdb53
commit 5dafc0828c
2 changed files with 6 additions and 3 deletions

View File

@ -195,9 +195,8 @@ uint32_t firmware_swdp_read(ADIv5_DP_t *dp, uint16_t addr)
uint32_t firmware_swdp_error(ADIv5_DP_t *dp)
{
uint32_t err, clr = 0;
if ((dp->idcode & ADIV5_DP_VERSION_MASK) == ADIV5_DPv2) {
if ((dp->fault && (dp->idcode & ADIV5_DP_VERSION_MASK) == ADIV5_DPv2) &&
dp->dp_low_write) {
/* On protocoll error target gets deselected.
* With DP Change, another target needs selection.
* => Reselect with right target! */
@ -206,6 +205,7 @@ uint32_t firmware_swdp_read(ADIv5_DP_t *dp, uint16_t addr)
uint32_t dummy;
dp->dp_low_read(dp, ADIV5_DP_IDCODE, &dummy);
}
uint32_t err, clr = 0;
err = adiv5_dp_read(dp, ADIV5_DP_CTRLSTAT) &
(ADIV5_DP_CTRLSTAT_STICKYORUN | ADIV5_DP_CTRLSTAT_STICKYCMP |
ADIV5_DP_CTRLSTAT_STICKYERR | ADIV5_DP_CTRLSTAT_WDATAERR);

View File

@ -478,6 +478,9 @@ bool cortexm_probe(ADIv5_AP_t *ap)
bool cortexm_attach(target *t)
{
ADIv5_AP_t *ap = cortexm_ap(t);
ap->dp->fault = 1; /* Force switch to this multi-drop device*/
target_check_error(t);
struct cortexm_priv *priv = t->priv;
unsigned i;
uint32_t r;