cortex_m: set the debug reason to DBGRQ when NVIC_DFSR indicates EXTERNAL 57/5157/2
authorTarek BOCHKATI <tarek.bouchkati@gmail.com>
Tue, 7 May 2019 15:16:15 +0000 (17:16 +0200)
committerTomas Vanek <vanekt@fbl.cz>
Thu, 23 May 2019 21:13:41 +0000 (22:13 +0100)
By definition the EXTERNAL bit in Debug Fault Status Register indicates
that an external debug request (EDBGRQ) signal was asserted.

Usage example: this could be done by CTI in multicore devices in order to
halt all the cores together.

Change-Id: I7830455ce5da6702b7d08c8fa7bfe80e4d8a5055
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/5157
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
src/target/cortex_m.c
src/target/cortex_m.h

index fba832c78737200c5e0e0179ee84564d7fe2c6a5..ce3ab09c01928b90434af3057573992e21442348 100644 (file)
@@ -392,7 +392,9 @@ static int cortex_m_examine_debug_reason(struct target *target)
                        target->debug_reason = DBG_REASON_WATCHPOINT;
                else if (cortex_m->nvic_dfsr & DFSR_VCATCH)
                        target->debug_reason = DBG_REASON_BREAKPOINT;
-               else    /* EXTERNAL, HALTED */
+               else if (cortex_m->nvic_dfsr & DFSR_EXTERNAL)
+                       target->debug_reason = DBG_REASON_DBGRQ;
+               else    /* HALTED */
                        target->debug_reason = DBG_REASON_UNDEFINED;
        }
 
index c33486273fc08f44eae89db6a2336238f69bd444..2f29903c8bf66b7607cab00059d3ea7a5848ac49 100644 (file)
 #define DFSR_BKPT                      2
 #define DFSR_DWTTRAP           4
 #define DFSR_VCATCH                    8
+#define DFSR_EXTERNAL          16
 
 #define FPCR_CODE 0
 #define FPCR_LITERAL 1

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)