|
From: openocd-gerrit <ope...@us...> - 2026-09-07 13:31:17
|
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 046c040cb0012e2f908bb11009b39bf502cff6f3 (commit)
from e7170da28f90b0a835361b70dcea0623335b8bba (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 046c040cb0012e2f908bb11009b39bf502cff6f3
Author: Samuel Obuch <sam...@es...>
Date: Thu Aug 13 11:31:35 2026 +0200
contrib/loaders: keep clock gating enabled in esp32s3 reset handler
After reset, clock gating needs to be enabled, otherwise breakpoints
placed by user before it is enabled by the software will be lost.
Original author: Alexey Gerenkov <al...@es...>
Change-Id: I2a5bc78c7385787b41cf413077ef4277bffffe0f
Signed-off-by: Samuel Obuch <sam...@es...>
Reviewed-on: https://review.openocd.org/c/openocd/+/9923
Reviewed-by: Tomas Vanek <va...@fb...>
Tested-by: jenkins
diff --git a/contrib/loaders/reset/espressif/esp32/esp32_cpu_reset_handler.S b/contrib/loaders/reset/espressif/esp32/esp32_cpu_reset_handler.S
index 506d41e85..08c70f5d4 100644
--- a/contrib/loaders/reset/espressif/esp32/esp32_cpu_reset_handler.S
+++ b/contrib/loaders/reset/espressif/esp32/esp32_cpu_reset_handler.S
@@ -111,7 +111,9 @@ start:
/* Clear APP_CPU boot address */
movi a4, DPORT_APPCPU_CTRL_D_REG
s32i.n a5, a4, 0
- /* Clear APP_CPU clock gating */
+ /* Set APP_CPU clock gating
+ otherwise APP_CPU with debug module will be reset by SW at startup
+ and breakpoints set just after reset will be lost */
movi a4, DPORT_APPCPU_CTRL_B_REG
movi a3, DPORT_APPCPU_CLKGATE_EN
s32i.n a3, a4, 0
diff --git a/contrib/loaders/reset/espressif/esp32s3/cpu_reset_handler_code.inc b/contrib/loaders/reset/espressif/esp32s3/cpu_reset_handler_code.inc
index dc9702c62..5ea5a7828 100644
--- a/contrib/loaders/reset/espressif/esp32s3/cpu_reset_handler_code.inc
+++ b/contrib/loaders/reset/espressif/esp32s3/cpu_reset_handler_code.inc
@@ -13,5 +13,5 @@
0xff,0x59,0x04,0x41,0xe2,0xff,0x59,0x04,0x41,0xe2,0xff,0x59,0x04,0x41,0xe1,0xff,
0x31,0xe2,0xff,0x39,0x04,0x41,0xe1,0xff,0x31,0xe2,0xff,0x39,0x04,0x41,0xe1,0xff,
0x59,0x04,0x41,0xe1,0xff,0x0c,0x23,0x39,0x04,0x41,0xe0,0xff,0x0c,0x43,0x39,0x04,
-0x52,0x64,0x00,0x41,0xdf,0xff,0x31,0xdf,0xff,0x32,0x64,0x00,0x00,0x70,0x00,0x46,
+0x0c,0x23,0x39,0x04,0x41,0xdf,0xff,0x31,0xdf,0xff,0x39,0x04,0x00,0x70,0x00,0x46,
0xfe,0xff,
diff --git a/contrib/loaders/reset/espressif/esp32s3/esp32s3_cpu_reset_handler.S b/contrib/loaders/reset/espressif/esp32s3/esp32s3_cpu_reset_handler.S
index 5fc635725..f4d3611b4 100644
--- a/contrib/loaders/reset/espressif/esp32s3/esp32s3_cpu_reset_handler.S
+++ b/contrib/loaders/reset/espressif/esp32s3/esp32s3_cpu_reset_handler.S
@@ -118,15 +118,19 @@ start:
/* Clear APP_CPU boot address */
movi a4, SYSTEM_CORE_1_CONTROL_1_REG
s32i.n a5, a4, 0
- /* Clear APP_CPU clock gating */
+ /* Set APP_CPU clock gating */
movi a4, SYSTEM_CORE_1_CONTROL_0_REG
movi a3, SYSTEM_CONTROL_CORE_1_CLKGATE_EN
s32i.n a3, a4, 0
- /* Set and clear APP_CPU reset */
+ /* Set APP_CPU reset */
movi a4, SYSTEM_CORE_1_CONTROL_0_REG
movi a3, SYSTEM_CONTROL_CORE_1_RESETING
s32i.n a3, a4, 0
- s32i.n a5, a4, 0
+ /* Clear APP_CPU reset and
+ set APP_CPU clock gating otherwise APP_CPU will be reset by SW at startup
+ and breakpoints set just after reset will be lost */
+ movi a3, SYSTEM_CONTROL_CORE_1_CLKGATE_EN
+ s32i.n a3, a4, 0
/* Restore the reset vector to ROM */
movi a4, RTC_CNTL_RESET_STATE_REG
movi a3, RTC_CNTL_RESET_STATE_DEF
-----------------------------------------------------------------------
Summary of changes:
.../loaders/reset/espressif/esp32/esp32_cpu_reset_handler.S | 4 +++-
.../loaders/reset/espressif/esp32s3/cpu_reset_handler_code.inc | 2 +-
.../reset/espressif/esp32s3/esp32s3_cpu_reset_handler.S | 10 +++++++---
3 files changed, 11 insertions(+), 5 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|