diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index 8fc07ca3d..c8fc91bb0 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -1985,7 +1985,7 @@ static int write_memory(struct target *target, uint32_t address, int dmi_error = check_dmi_error(target); // Clear autoexec. - dmi_write(target, DMI_ABSTRACTCS, DMI_ABSTRACTCS_CMDERR); + dmi_write(target, DMI_ABSTRACTAUTO, 0); uint32_t abstractcs = dmi_read(target, DMI_ABSTRACTCS); unsigned cmderr = get_field(abstractcs, DMI_ABSTRACTCS_CMDERR); if (cmderr == CMDERR_BUSY) {