From 29dc94c3d619c388b06e6b0e09d2e4cb07a0ae34 Mon Sep 17 00:00:00 2001 From: dragonmux Date: Tue, 17 May 2022 17:04:18 -0400 Subject: [PATCH] hosted: with mubes help, fixes some issues with how we talk CMSIS-DAP --- src/platforms/hosted/dap.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/platforms/hosted/dap.c b/src/platforms/hosted/dap.c index 3adc424b..d710bbf4 100644 --- a/src/platforms/hosted/dap.c +++ b/src/platforms/hosted/dap.c @@ -278,7 +278,10 @@ void dap_reset_pin(int state) buf[1] = state ? DAP_SWJ_nRESET : 0; // Value buf[2] = DAP_SWJ_nRESET; // Select buf[3] = 0; // Wait - dbg_dap_cmd(buf, sizeof(buf), 4); + buf[4] = 0; // Wait + buf[5] = 0; // Wait + buf[6] = 0; // Wait + dbg_dap_cmd(buf, sizeof(buf), 7); } void dap_trst_reset(void) @@ -797,8 +800,9 @@ bool dap_sequence_test(void) { uint8_t buf[4] = { ID_DAP_SWD_SEQUENCE, - 1, - 0 /* one idle cycle */ + 0x1, + 0x81, /* Read one bit */ + 0 /* one idle cycle */ }; dbg_dap_cmd(buf, sizeof(buf), 3); return (buf[0] == DAP_OK);