From 207f4d39ff8326d7e4d1be9d136e91ad88d123c8 Mon Sep 17 00:00:00 2001 From: Rafael Silva Date: Mon, 17 Jul 2023 19:47:12 +0100 Subject: [PATCH] target/adiv5: remove unused try except block 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: 0c6390307115b48e57deeecf0be8f5eca89604ac 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 --- src/target/adiv5.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/target/adiv5.c b/src/target/adiv5.c index ecb40c6c256..bb36a577111 100644 --- a/src/target/adiv5.c +++ b/src/target/adiv5.c @@ -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);