cortex_m: Do additional initialization during reset
[openocd.git] / src / target / cortex_m.c
index dc8d344401abe7d83f0db75d7b379b4f45489f61..103ce502a1820bf9f7f9a2ec31e4c80b7a6f21d6 100644 (file)
@@ -1069,6 +1069,19 @@ static int cortex_m_assert_reset(struct target *target)
                                "handler to reset any peripherals or configure hardware srst support.");
                }
 
+               /*
+                 SAM4L needs to execute security initalization
+                 startup sequence before AP access would be enabled.
+                 During the intialization CDBGPWRUPACK is pulled low and we
+                 need to wait for it to be set to 1 again.
+               */
+               retval = dap_dp_poll_register(swjdp, DP_CTRL_STAT,
+                                             CDBGPWRUPACK, CDBGPWRUPACK, 100);
+               if (retval != ERROR_OK) {
+                       LOG_ERROR("Failed waitnig for CDBGPWRUPACK");
+                       return ERROR_FAIL;
+               }
+
                {
                        /* I do not know why this is necessary, but it
                         * fixes strange effects (step/resume cause NMI

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)