I'm trying to chase down problems with the LPC1768. I've run into an old problem with an error message:
Invalid ACK 0x7 in JTAG-DP transaction There is a vestige of an old kludge that I've tinkered with in the attached patch. However, I have evidence that the timing of how quickly openocd runs and the length of turnaround times for jtag_execute_queue() affects whether or not the problem above appears. Does anyone have any insights to share on the kludge that I've tinkered with in the patch? (I have limited access to lpc1768 for testing...) -- Øyvind Harboe US toll free 1-866-980-3434 / International +47 51 63 25 00 http://www.zylin.com/zy1000.html ARM7 ARM9 ARM11 XScale Cortex JTAG debugger and flash programmer
From cb944a4feb0e662d31f053e75671c45e9346617b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= <oyvind.har...@zylin.com> Date: Sat, 31 Jul 2010 15:40:07 +0200 Subject: [PATCH] cortex-m3: lpc1768 workaround MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is a timing sensitive problem where reading ctrlstat the first time can fail(or return garbage). Reenabling old kludge. Signed-off-by: Øyvind Harboe <oyvind.har...@zylin.com> --- src/target/adi_v5_jtag.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/target/adi_v5_jtag.c b/src/target/adi_v5_jtag.c index 8731a1a..c7bd07b 100644 --- a/src/target/adi_v5_jtag.c +++ b/src/target/adi_v5_jtag.c @@ -191,10 +191,15 @@ static int jtagdp_transaction_endcheck(struct adiv5_dap *dap) /* too expensive to call keep_alive() here */ -#if 0 +#if 1 + uint32_t dummy; /* Danger!!!! BROKEN!!!! */ - adi_jtag_scan_inout_check_u32(dap, JTAG_DP_DPACC, - DP_CTRL_STAT, DPAP_READ, 0, &ctrlstat); + retval = adi_jtag_scan_inout_check_u32(dap, JTAG_DP_DPACC, + DP_CTRL_STAT, DPAP_READ, 0, &dummy); + if (retval != ERROR_OK) + { + LOG_WARNING("KLUDGE! Why does reading ctrlstat fail the first time???? (e.g. LPC1768)"); + } /* Danger!!!! BROKEN!!!! Why will jtag_execute_queue() fail here???? R956 introduced the check on return value here and now Michael Schwingen reports that this code no longer works.... @@ -203,7 +208,7 @@ static int jtagdp_transaction_endcheck(struct adiv5_dap *dap) */ if ((retval = jtag_execute_queue()) != ERROR_OK) { - LOG_ERROR("BUG: Why does this fail the first time????"); + LOG_WARNING("KLUDGE! reading ctrlstat callbacks failed first time?"); } /* Why??? second time it works??? */ #endif -- 1.7.0.4
_______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development