From: Guido Günther Date: Fri, 10 Aug 2018 10:01:17 +0000 (+0200) Subject: target: armv8: Ensure target is halted for virt2phys X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2a3b709aa5d1ab83faed1dc7c296ffc117022d62;p=openocd target: armv8: Ensure target is halted for virt2phys Othewise the error reported as Timeout waiting for dpm prepare Change-Id: Ieed2fdcd94ae4e877a749df3eec07a01dbf80b10 Closes: https://sourceforge.net/p/openocd/tickets/201/ Found-by: Matthias Welwarsky Signed-off-by: Guido Günther Reviewed-on: http://openocd.zylin.com/4647 Tested-by: jenkins Reviewed-by: Matthias Welwarsky --- diff --git a/src/target/armv8.c b/src/target/armv8.c index dfa2c67a..75ada896 100644 --- a/src/target/armv8.c +++ b/src/target/armv8.c @@ -936,6 +936,11 @@ int armv8_mmu_translate_va_pa(struct target *target, target_addr_t va, "Secure", "Not Secure" }; + if (target->state != TARGET_HALTED) { + LOG_WARNING("target %s not halted", target_name(target)); + return ERROR_TARGET_NOT_HALTED; + } + retval = dpm->prepare(dpm); if (retval != ERROR_OK) return retval;