From 4af0ca75597cd0d868381a06f051431c2356e35d Mon Sep 17 00:00:00 2001 From: dragonmux Date: Sun, 26 Feb 2023 08:27:51 +0000 Subject: [PATCH] hoted/cmsis_dap: Changed the phase when dap_jtag_configure() is called as it was happening too late --- src/platforms/hosted/cmsis_dap.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/platforms/hosted/cmsis_dap.c b/src/platforms/hosted/cmsis_dap.c index 37443714652..ad3198d1cc1 100644 --- a/src/platforms/hosted/cmsis_dap.c +++ b/src/platforms/hosted/cmsis_dap.c @@ -506,10 +506,6 @@ static void dap_mem_write(adiv5_access_port_s *ap, uint32_t dest, const void *sr void dap_adiv5_dp_defaults(adiv5_debug_port_s *dp) { - /* Try to configure the JTAG engine on the adaptor if we're in JTAG mode */ - /* XXX: If this fails we don't currently tell the invoking code which will make things go v. wrong */ - if (mode == DAP_CAP_JTAG && !dap_jtag_configure()) - return; /* Setup the access functions for this adaptor */ dp->ap_read = dap_ap_read; dp->ap_write = dap_ap_write; @@ -573,6 +569,9 @@ bool dap_jtagtap_init(void) void dap_jtag_dp_init(adiv5_debug_port_s *dp) { + /* Try to configure the JTAG engine on the adaptor */ + if (!dap_jtag_configure()) + return; dp->dp_read = dap_dp_read_reg; dp->low_access = dap_dp_low_access; dp->abort = dap_dp_abort;