aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2021-05-17 12:19:57 -0700
committerTim Newsome <tim@sifive.com>2021-05-17 12:19:57 -0700
commit4e6fe83f8362c4292b6348b6f7bb599c375855f5 (patch)
tree19a6707c6cfd5bb4c32b2988e02d6e9848514a55
parent621e6e43d220db1fb11ce3075de229da00154942 (diff)
downloadriscv-openocd-4e6fe83f8362c4292b6348b6f7bb599c375855f5.zip
riscv-openocd-4e6fe83f8362c4292b6348b6f7bb599c375855f5.tar.gz
riscv-openocd-4e6fe83f8362c4292b6348b6f7bb599c375855f5.tar.bz2
remote bitbang, flush resets.
Waiting until the next execute_queue() might mean the target doesn't see the reset signal asserted for a significant amount of time. Change-Id: Id8514ddb30e88040131a6dba2b90b65463f10b76 Signed-off-by: Tim Newsome <tim@sifive.com>
-rw-r--r--src/jtag/drivers/remote_bitbang.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/jtag/drivers/remote_bitbang.c b/src/jtag/drivers/remote_bitbang.c
index 214fa43..b9ea7e4 100644
--- a/src/jtag/drivers/remote_bitbang.c
+++ b/src/jtag/drivers/remote_bitbang.c
@@ -203,7 +203,9 @@ static int remote_bitbang_write(int tck, int tms, int tdi)
static int remote_bitbang_reset(int trst, int srst)
{
char c = 'r' + ((trst ? 0x2 : 0x0) | (srst ? 0x1 : 0x0));
- return remote_bitbang_queue(c, false);
+ /* Always flush the send buffer on reset, because the reset call need not be
+ * followed by jtag_execute_queue(). */
+ return remote_bitbang_queue(c, true);
}
static int remote_bitbang_blink(int on)
@@ -354,6 +356,10 @@ static const struct command_registration remote_bitbang_command_handlers[] = {
static int remote_bitbang_execute_queue(void)
{
+ /* safety: the send buffer must be empty, no leftover characters from
+ * previous transactions */
+ assert(remote_bitbang_send_buf_used == 0);
+
/* process the JTAG command queue */
int ret = bitbang_execute_queue();
if (ret != ERROR_OK)