aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Vanek <vanekt@fbl.cz>2019-01-09 11:59:35 +0100
committerTomas Vanek <vanekt@fbl.cz>2019-01-27 20:59:13 +0000
commitd4790209507ebda2de7fe124db2dc8e6a9122d4c (patch)
tree12b324b30db19f7dfc0079826c8f4e3d99d7e996
parentd0eb66f729ff50ffa21a3ea22bcff46167fe627a (diff)
downloadriscv-openocd-d4790209507ebda2de7fe124db2dc8e6a9122d4c.zip
riscv-openocd-d4790209507ebda2de7fe124db2dc8e6a9122d4c.tar.gz
riscv-openocd-d4790209507ebda2de7fe124db2dc8e6a9122d4c.tar.bz2
target/cortex_m: inform if an external reset occurs
Change-Id: I873e73012c44aac7af3b21b633bd096d8e299d07 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/4840 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
-rw-r--r--src/target/cortex_m.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c
index 06e1c1c..3c97bc3 100644
--- a/src/target/cortex_m.c
+++ b/src/target/cortex_m.c
@@ -510,7 +510,10 @@ static int cortex_m_poll(struct target *target)
}
if (cortex_m->dcb_dhcsr & S_RESET_ST) {
- target->state = TARGET_RESET;
+ if (target->state != TARGET_RESET) {
+ target->state = TARGET_RESET;
+ LOG_INFO("%s: external reset detected", target_name(target));
+ }
return ERROR_OK;
}