From: OpenOCD-Gerrit <ope...@us...> - 2014-06-28 18:52:18
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 7c101b9e31e454b25d88adeca7440ae6ce7620f5 (commit) from 52b80fbd82d80425863823b3fe26d47a702febb0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 7c101b9e31e454b25d88adeca7440ae6ce7620f5 Author: Mathias K <ke...@fr...> Date: Tue Feb 26 17:24:41 2013 +0100 Add error handling and remove double readout. Remove double readout of DCB_DHCSR in target poll. The return value of the endreset event is handled and not ignored in target poll. Change-Id: I8fe026418dadcf0b0dcbb09acee871ad950937a2 Signed-off-by: Mathias K <ke...@fr...> Reviewed-on: http://openocd.zylin.com/1181 Tested-by: jenkins Reviewed-by: Freddie Chopin <fre...@gm...> diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c index 103ce50..aafc097 100644 --- a/src/target/cortex_m.c +++ b/src/target/cortex_m.c @@ -521,15 +521,8 @@ static int cortex_m_poll(struct target *target) } if (cortex_m->dcb_dhcsr & S_RESET_ST) { - /* check if still in reset */ - retval = mem_ap_read_atomic_u32(swjdp, DCB_DHCSR, &cortex_m->dcb_dhcsr); - if (retval != ERROR_OK) - return retval; - - if (cortex_m->dcb_dhcsr & S_RESET_ST) { - target->state = TARGET_RESET; - return ERROR_OK; - } + target->state = TARGET_RESET; + return ERROR_OK; } if (target->state == TARGET_RESET) { @@ -538,7 +531,11 @@ static int cortex_m_poll(struct target *target) */ LOG_DEBUG("Exit from reset with dcb_dhcsr 0x%" PRIx32, cortex_m->dcb_dhcsr); - cortex_m_endreset_event(target); + retval = cortex_m_endreset_event(target); + if (retval != ERROR_OK) { + target->state = TARGET_UNKNOWN; + return retval; + } target->state = TARGET_RUNNING; prev_target_state = TARGET_RUNNING; } ----------------------------------------------------------------------- Summary of changes: src/target/cortex_m.c | 17 +++++++---------- 1 files changed, 7 insertions(+), 10 deletions(-) hooks/post-receive -- Main OpenOCD repository |