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>
log_output
Tomas Vanek 2019-01-09 11:59:35 +01:00
parent d0eb66f729
commit d479020950
1 changed files with 4 additions and 1 deletions

View File

@ -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;
}