From 2a3b709aa5d1ab83faed1dc7c296ffc117022d62 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Guido=20G=C3=BCnther?= Date: Fri, 10 Aug 2018 12:01:17 +0200 Subject: [PATCH] target: armv8: Ensure target is halted for virt2phys MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/target/armv8.c | 5 +++++ 1 file changed, 5 insertions(+) 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; -- 2.39.5