From: Spencer Oliver Date: Fri, 21 May 2010 10:43:17 +0000 (+0100) Subject: arm_adi_v5: correct ahbap_debugport_init mem-ap id (bug #23) X-Git-Tag: v0.5.0-rc1~673 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c0cdb7c63189edf0d96a1b0242d80c94532b30e7;p=openocd arm_adi_v5: correct ahbap_debugport_init mem-ap id (bug #23) We request a id register read at the end of ahbap_debugport_init but we never actually run the queue. In some cases this causes a segfault. Signed-off-by: Spencer Oliver --- diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index 8b18fa3c..8f43f78a 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -967,6 +967,9 @@ int ahbap_debugport_init(struct adiv5_dap *dap) retval = dap_queue_ap_read(dap, AP_REG_IDR, &idreg); retval = dap_queue_ap_read(dap, AP_REG_BASE, &romaddr); + if ((retval = dap_run(dap)) != ERROR_OK) + return retval; + LOG_DEBUG("MEM-AP #%" PRId32 " ID Register 0x%" PRIx32 ", Debug ROM Address 0x%" PRIx32, dap->apsel, idreg, romaddr);