From 0f5fb6b9a0f09f25466f9786731ad39eeba70ec9 Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Fri, 9 Oct 2020 14:03:22 +0200 Subject: [PATCH] remote: Initialise dp_read and low_access with SWD_INIT. Before "mon s" after "mon j" failed. --- src/remote.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/remote.c b/src/remote.c index 765afc3..87e8620 100644 --- a/src/remote.c +++ b/src/remote.c @@ -126,12 +126,10 @@ static void _respondS(char respCode, const char *s) } static ADIv5_DP_t remote_dp = { - .dp_read = firmware_swdp_read, .ap_read = firmware_ap_read, .ap_write = firmware_ap_write, .mem_read = firmware_mem_read, .mem_write_sized = firmware_mem_write_sized, - .low_access = firmware_swdp_low_access, }; @@ -144,6 +142,8 @@ void remotePacketProcessSWD(uint8_t i, char *packet) switch (packet[1]) { case REMOTE_INIT: /* SS = initialise =============================== */ if (i==2) { + remote_dp.dp_read = firmware_swdp_read; + remote_dp.low_access = firmware_swdp_low_access; swdptap_init(); _respond(REMOTE_RESP_OK, 0); } else { @@ -192,9 +192,9 @@ void remotePacketProcessJTAG(uint8_t i, char *packet) switch (packet[1]) { case REMOTE_INIT: /* JS = initialise ============================= */ - jtagtap_init(); remote_dp.dp_read = fw_adiv5_jtagdp_read; remote_dp.low_access = fw_adiv5_jtagdp_low_access; + jtagtap_init(); _respond(REMOTE_RESP_OK, 0); break;