Skip to content

Commit

Permalink
target/adiv5: remove unused try except block
Browse files Browse the repository at this point in the history
This try execpt block was watching for a timeout, but there are at the
moment no timeout exceptions thrown in the codebase

The original exeption present in the adiv5_dp_read stack this code was
likely handling was removed in commit:
0c63903
where the abort to recover from bad access implemented by the
exeption case of this block was also implemented at a lower level
this means the exception block code was never run, and the re-read on
timeout probably stoped happening since then

Currently a protocol recovery mechanism is implemented which should
provide the functionality this code was originally trying to employ
  • Loading branch information
perigoso committed Jul 19, 2023
1 parent dfa9063 commit 207f4d3
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/target/adiv5.c
Original file line number Diff line number Diff line change
Expand Up @@ -874,15 +874,8 @@ void adiv5_dp_init(adiv5_debug_port_s *const dp, const uint32_t idcode)
return;
}

volatile uint32_t ctrlstat = 0;
TRY_CATCH (e, EXCEPTION_TIMEOUT) {
ctrlstat = adiv5_dp_read(dp, ADIV5_DP_CTRLSTAT);
}
if (e.type) {
DEBUG_WARN("DP not responding! Trying abort sequence...\n");
adiv5_dp_abort(dp, ADIV5_DP_ABORT_DAPABORT);
ctrlstat = adiv5_dp_read(dp, ADIV5_DP_CTRLSTAT);
}
/* Read DP Control/Status */
uint32_t ctrlstat = adiv5_dp_read(dp, ADIV5_DP_CTRLSTAT);

platform_timeout_s timeout;
platform_timeout_set(&timeout, 201);
Expand Down

0 comments on commit 207f4d3

Please sign in to comment.