adiv5_swdp: On ACK_FAULT, error() and try again once #731

when writing CSW.
This commit is contained in:
Uwe Bonnes 2020-09-17 22:02:54 +02:00 committed by UweBonnes
parent a4a934f461
commit bdb351a6ea
1 changed files with 6 additions and 0 deletions

View File

@ -146,6 +146,12 @@ uint32_t firmware_swdp_low_access(ADIv5_DP_t *dp, uint8_t RnW,
do { do {
swd_proc.swdptap_seq_out(request, 8); swd_proc.swdptap_seq_out(request, 8);
ack = swd_proc.swdptap_seq_in(3); ack = swd_proc.swdptap_seq_in(3);
if (ack == SWDP_ACK_FAULT) {
/* On fault, abort() and repeat the command once.*/
firmware_swdp_error(dp);
swd_proc.swdptap_seq_out(request, 8);
ack = swd_proc.swdptap_seq_in(3);
}
} while (ack == SWDP_ACK_WAIT && !platform_timeout_is_expired(&timeout)); } while (ack == SWDP_ACK_WAIT && !platform_timeout_is_expired(&timeout));
if (ack == SWDP_ACK_WAIT) if (ack == SWDP_ACK_WAIT)