I'm not too familiar with that code or the problem w/PLL/clocks that
you are seing,
but I modified it to wait 1000ms rather than try 100 times...
Seems a tad more robust to me.
Index: C:/workspace/openocd/src/target/cortex_swjdp.c
===================================================================
--- C:/workspace/openocd/src/target/cortex_swjdp.c (revision 1014)
+++ C:/workspace/openocd/src/target/cortex_swjdp.c (working copy)
@@ -175,7 +175,6 @@
int swjdp_transaction_endcheck(swjdp_common_t *swjdp)
{
int retval;
- int waitcount = 0;
u32 ctrlstat;
keep_alive();
@@ -199,6 +198,7 @@
swjdp->ack = swjdp->ack & 0x7;
+ long long then=timeval_ms();
while (swjdp->ack != 2)
{
if (swjdp->ack == 1)
@@ -203,10 +203,9 @@
{
if (swjdp->ack == 1)
{
- waitcount++;
- if (waitcount > 100)
+ if ((timeval_ms()-then) > 1000)
{
- LOG_WARNING("Timeout waiting for ACK = OK/FAULT
in SWJDP transaction");
+ LOG_WARNING("Timeout (1000ms) waiting for ACK =
OK/FAULT in SWJDP
transaction");
return ERROR_JTAG_DEVICE_ERROR;
}
}
--
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer
Free eCos workshop in Oslo October 21!
http://www.zylin.com/workshop.html
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development