|
From: openocd-gerrit <ope...@us...> - 2024-11-02 21:00:20
|
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 3ce0962f2c525595bcbd0bd5da73673e236fc42d (commit)
from 7214c8be46f749f210e00d334c30883bd73cca03 (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 3ce0962f2c525595bcbd0bd5da73673e236fc42d
Author: Antonio Borneo <bor...@gm...>
Date: Mon Jul 15 11:56:36 2024 +0200
target: cortex_m: fix polling for target kept under reset
In multi-target SoC not all the targets are running simultaneously
and some target could be powered off or kept under reset.
Commit 4892e32294c6 ("target/cortex_m: allow poll quickly get out
of TARGET_RESET state") does not considers the case of a target
that is kept in reset and expects the target to change state from
TARGET_RESET immediately.
This causes OpenOCD to log continuously:
Info : [stm32mp15x.cm4] external reset detected
Info : [stm32mp15x.cm4] external reset detected
Info : [stm32mp15x.cm4] external reset detected
Read again dhcsr to detect the 'stable' reset status and quit,
waiting for next poll to re-check the target's status.
Change-Id: Ic66029b988404a1599bb99bc66d4a8845b8b02c6
Signed-off-by: Antonio Borneo <bor...@gm...>
Fixes: 4892e32294c6 ("target/cortex_m: allow poll quickly get out of TARGET_RESET state")
Reviewed-on: https://review.openocd.org/c/openocd/+/8399
Reviewed-by: Tomas Vanek <va...@fb...>
Tested-by: jenkins
diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c
index bd0e8d886..e78d2e29b 100644
--- a/src/target/cortex_m.c
+++ b/src/target/cortex_m.c
@@ -989,6 +989,18 @@ static int cortex_m_poll_one(struct target *target)
* and keep it until the next poll to allow its detection */
return ERROR_OK;
}
+
+ /* refresh status bits */
+ retval = cortex_m_read_dhcsr_atomic_sticky(target);
+ if (retval != ERROR_OK)
+ return retval;
+
+ /* If still under reset, quit and re-check at next poll */
+ if (cortex_m->dcb_dhcsr_cumulated_sticky & S_RESET_ST) {
+ cortex_m->dcb_dhcsr_cumulated_sticky &= ~S_RESET_ST;
+ return ERROR_OK;
+ }
+
/* S_RESET_ST was expected (in a reset command). Continue processing
* to quickly get out of TARGET_RESET state */
}
-----------------------------------------------------------------------
Summary of changes:
src/target/cortex_m.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
hooks/post-receive
--
Main OpenOCD repository
|