- added "init" command. "init" and "reset" at end of startup script is equivalent
[openocd.git] / src / target / arm7_9_common.c
index d77f2000279abbd6e619bf472062b80dfddf0f77..106b95db1c599d9cf8de25eb03eab6a61ed501a7 100644 (file)
@@ -755,6 +755,14 @@ int arm7_9_assert_reset(target_t *target)
 
        if ((target->reset_mode == RESET_HALT) || (target->reset_mode == RESET_INIT))
        {
+               reg_t *dbg_ctrl = &arm7_9->eice_cache->reg_list[EICE_DBG_CTRL];
+               
+               /* program EmbeddedICE Debug Control Register to deassert DBGRQ
+                * i.e. resume.
+                */
+               buf_set_u32(dbg_ctrl->value, EICE_DBG_CONTROL_DBGRQ, 1, 0);     
+               embeddedice_store_reg(dbg_ctrl);
+
                /*
                 * Some targets do not support communication while SRST is asserted. We need to
                 * set up the reset vector catch here.
@@ -777,16 +785,6 @@ int arm7_9_assert_reset(target_t *target)
                }
        }
 
-       /* we can't know what state the target is in as we might e.g.
-        * be resetting after a power dropout, so we need to issue a tms/srst
-        */
-       
-       /* assert SRST and TRST */
-       /* system would get ouf sync if we didn't reset test-logic, too */
-       jtag_add_reset(1, 1);
-       
-       jtag_add_sleep(5000);
-
        /* here we should issue a srst only, but we may have to assert trst as well */
        if (jtag_reset_config & RESET_SRST_PULLS_TRST)
        {
@@ -965,6 +963,15 @@ int arm7_9_halt(target_t *target)
                        LOG_ERROR("can't request a halt while in reset if nSRST pulls nTRST");
                        return ERROR_TARGET_FAILURE;
                }
+               else
+               {
+                       /* we came here in a reset_halt or reset_init sequence
+                        * debug entry was already prepared in arm7_9_prepare_reset_halt()
+                        */
+                       target->debug_reason = DBG_REASON_DBGRQ;
+                       
+                       return ERROR_OK; 
+               }
        }
 
        if (arm7_9->use_dbgrq)

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)