On Thursday 03 December 2009, Øyvind Harboe wrote:
> Error: The 'init' command must be used before 'init'.
> Command handler execution failed
> Warn : jtag initialization failed; try 'jtag init' again.

Yeah, everything seems to cause JTAG init to fail lately.

One issue seems to be:

==================
Not clear *why* this is happening all of a sudden, but
JTAG initialization seems to be bypassing the code
which forced the adapter to set TRST and SRST status
to zero/inactive.

On a TRST-less board, TRST is getting left as "-1"
indicating never-initialized, so tests relying on
it being only zero or one (i.e. everything after
the initialization code that's now bypassed) fail.

--- a/src/jtag/core.c
+++ b/src/jtag/core.c
@@ -153,7 +153,7 @@ bool is_jtag_poll_safe(void)
         * It is also implicitly disabled while TRST is active and
         * while SRST is gating the JTAG clock.
         */
-       if (!jtag_poll || jtag_trst != 0)
+       if (!jtag_poll || jtag_trst == 1)
                return false;
        return jtag_srst == 0 || (jtag_reset_config & RESET_SRST_NO_GATING);
 }
@@ -347,7 +347,7 @@ int jtag_call_event_callbacks(enum jtag_event event)
 
 static void jtag_checks(void)
 {
-       assert(jtag_trst == 0);
+       assert(jtag_trst != 1);
 }
 
 static void jtag_prelude(tap_state_t state)

_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to