From a4caec29b9bf1efa80b4beb7d0b0d153fa2c82de Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Sun, 31 Oct 2021 10:52:18 +0100 Subject: [PATCH] dap_swdptap_seq_out: Write only needed data Dragonprobe (origin/cmsisdap-fixes, 211031) hanged on additional byes in the SWJ_Sequence request. --- src/platforms/hosted/dap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platforms/hosted/dap.c b/src/platforms/hosted/dap.c index cc58031c..39318b31 100644 --- a/src/platforms/hosted/dap.c +++ b/src/platforms/hosted/dap.c @@ -764,7 +764,7 @@ int dap_jtag_configure(void) void dap_swdptap_seq_out(uint32_t MS, int ticks) { - uint8_t buf[] = { + uint8_t buf[64] = { ID_DAP_SWJ_SEQUENCE, ticks, (MS >> 0) & 0xff, @@ -772,7 +772,7 @@ void dap_swdptap_seq_out(uint32_t MS, int ticks) (MS >> 16) & 0xff, (MS >> 24) & 0xff }; - dbg_dap_cmd(buf, 1, sizeof(buf)); + dbg_dap_cmd(buf, 64, 2 + ((ticks +7) >> 3)); if (buf[0]) DEBUG_WARN("dap_swdptap_seq_out error\n"); }