From 7674571d468e025e272291f4cedf002cd00344ef Mon Sep 17 00:00:00 2001 From: Erhan Kurubas Date: Mon, 27 Jul 2026 14:37:01 +0300 Subject: [PATCH] change(system): increase OCD stub memory reservation from 8K to 12K --- components/esp_system/Kconfig | 4 ++-- components/esp_system/ld/ld.iram.sections | 4 ++-- components/esp_tee/subproject/main/ld/esp32c6/esp_tee.ld.in | 2 +- components/esp_tee/subproject/main/ld/esp32h2/esp_tee.ld.in | 2 +- docs/en/api-guides/jtag-debugging/tips-and-quirks.rst | 2 +- docs/zh_CN/api-guides/jtag-debugging/tips-and-quirks.rst | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/components/esp_system/Kconfig b/components/esp_system/Kconfig index 423eb9de641..3e96883d44a 100644 --- a/components/esp_system/Kconfig +++ b/components/esp_system/Kconfig @@ -582,7 +582,7 @@ menu "ESP System Settings" which does some useful debugging stuff, e.g. GCOV data dump. config ESP_DEBUG_INCLUDE_OCD_STUB_BINS - bool "Preload OpenOCD stub binaries to speed up debugging. 8K memory will be reserved" + bool "Preload OpenOCD stub binaries to speed up debugging. 12K memory will be reserved" default n depends on SOC_DEBUG_HAVE_OCD_STUB_BINS help @@ -591,7 +591,7 @@ menu "ESP System Settings" To execute stub code, OpenOCD allocates memory on the target device, backs up the existing memory, loads the stub binary, runs the binary, and then restores the original memory. This process can be time-consuming, especially when using USB serial JTAG. - By enabling this option, 8K of memory in RAM will be preallocated with the stub code, + By enabling this option, 12K of memory in RAM will be preallocated with the stub code, eliminating the need to back up and restore the memory region. config ESP_DEBUG_OCDAWARE diff --git a/components/esp_system/ld/ld.iram.sections b/components/esp_system/ld/ld.iram.sections index 5a44f0c87f3..86ee1ba7c25 100644 --- a/components/esp_system/ld/ld.iram.sections +++ b/components/esp_system/ld/ld.iram.sections @@ -9,14 +9,14 @@ /* Do not move this block! OpenOCD expects this to be at the beginning of IRAM. */ KEEP(*(.ocd_stub.code)); KEEP(*(.ocd_stub.tramp)); - . = ALIGN(0x800); + . = ALIGN(0x1000); KEEP(*(.ocd_stub.data)); KEEP(*(.ocd_stub.bss)); KEEP(*(.ocd_stub.stack)); KEEP(*(.ocd_stub.params)); . = ALIGN(0x1000); KEEP(*(.ocd_stub.scratchmem)); - ASSERT(ABSOLUTE(.) == _iram_start + 0x2000, "openocd stub memory must be ended at _iram_start + 0x2000"); + ASSERT(ABSOLUTE(.) == _iram_start + 0x3000, "openocd stub memory must be ended at _iram_start + 0x3000"); #endif /* Vectors go to start of IRAM */ diff --git a/components/esp_tee/subproject/main/ld/esp32c6/esp_tee.ld.in b/components/esp_tee/subproject/main/ld/esp32c6/esp_tee.ld.in index 4ab75b2af64..bed85f99a45 100644 --- a/components/esp_tee/subproject/main/ld/esp32c6/esp_tee.ld.in +++ b/components/esp_tee/subproject/main/ld/esp32c6/esp_tee.ld.in @@ -33,7 +33,7 @@ */ #if CONFIG_ESP_DEBUG_INCLUDE_OCD_STUB_BINS -PROVIDE ( esp_tee_app_config = SRAM_REE_SEG_START + 0x22e0 ); +PROVIDE ( esp_tee_app_config = SRAM_REE_SEG_START + 0x32e0 ); #else PROVIDE ( esp_tee_app_config = SRAM_REE_SEG_START + 0x2e0 ); #endif diff --git a/components/esp_tee/subproject/main/ld/esp32h2/esp_tee.ld.in b/components/esp_tee/subproject/main/ld/esp32h2/esp_tee.ld.in index 8fab6ff223f..55211365db8 100644 --- a/components/esp_tee/subproject/main/ld/esp32h2/esp_tee.ld.in +++ b/components/esp_tee/subproject/main/ld/esp32h2/esp_tee.ld.in @@ -33,7 +33,7 @@ */ #if CONFIG_ESP_DEBUG_INCLUDE_OCD_STUB_BINS -PROVIDE ( esp_tee_app_config = SRAM_REE_SEG_START + 0x22e0 ); +PROVIDE ( esp_tee_app_config = SRAM_REE_SEG_START + 0x32e0 ); #else PROVIDE ( esp_tee_app_config = SRAM_REE_SEG_START + 0x2e0 ); #endif diff --git a/docs/en/api-guides/jtag-debugging/tips-and-quirks.rst b/docs/en/api-guides/jtag-debugging/tips-and-quirks.rst index 1527f7f7f21..b05a51ec911 100644 --- a/docs/en/api-guides/jtag-debugging/tips-and-quirks.rst +++ b/docs/en/api-guides/jtag-debugging/tips-and-quirks.rst @@ -115,7 +115,7 @@ In order to achieve higher data rates and minimize number of dropped packets it Improve Debugging Speed ^^^^^^^^^^^^^^^^^^^^^^^ - Enabling :ref:`CONFIG_ESP_DEBUG_INCLUDE_OCD_STUB_BINS` allocates 8 KB of RAM and embeds pre-built stub binaries into RAM. This improves the overall debugging speed by eliminating the need to load the stub binaries at runtime. It is particularly beneficial when using flash breakpoints, as it reduces the latency of add/remove breakpoints. However, keep in mind that the increased RAM usage may reduce memory availability for other tasks. + Enabling :ref:`CONFIG_ESP_DEBUG_INCLUDE_OCD_STUB_BINS` allocates 12 KB of RAM and embeds pre-built stub binaries into RAM. This improves the overall debugging speed by eliminating the need to load the stub binaries at runtime. It is particularly beneficial when using flash breakpoints, as it reduces the latency of add/remove breakpoints. However, keep in mind that the increased RAM usage may reduce memory availability for other tasks. .. _jtag-debugging-tip-debugger-startup-commands: diff --git a/docs/zh_CN/api-guides/jtag-debugging/tips-and-quirks.rst b/docs/zh_CN/api-guides/jtag-debugging/tips-and-quirks.rst index 508fc3c85dc..22fda002a22 100644 --- a/docs/zh_CN/api-guides/jtag-debugging/tips-and-quirks.rst +++ b/docs/zh_CN/api-guides/jtag-debugging/tips-and-quirks.rst @@ -115,7 +115,7 @@ GDB 具有 FreeRTOS 支持的 Python 扩展模块。在系统要求满足的情 提高调试速度 ^^^^^^^^^^^^^^^^^^^^^^^ - 启用 :ref:`CONFIG_ESP_DEBUG_INCLUDE_OCD_STUB_BINS` 将预先分配 8 KB 的 RAM, 且预编译的存根二进制文件将嵌入到 RAM 中,因此运行时将无需加载存根二进制文件,从而提高整体调试速度。在使用 flash 断点时,上述优化可以有效降低添加和删除断点的延迟。但要注意,RAM 使用量的增加可能会占用其他任务所需的内存。 + 启用 :ref:`CONFIG_ESP_DEBUG_INCLUDE_OCD_STUB_BINS` 将预先分配 12 KB 的 RAM, 且预编译的存根二进制文件将嵌入到 RAM 中,因此运行时将无需加载存根二进制文件,从而提高整体调试速度。在使用 flash 断点时,上述优化可以有效降低添加和删除断点的延迟。但要注意,RAM 使用量的增加可能会占用其他任务所需的内存。 .. _jtag-debugging-tip-debugger-startup-commands: