@@ -8,10 +8,6 @@ tools.xtensa-esp-elf-gdb.path={runtime.platform.path}/tools/xtensa-esp-elf-gdb
8
8
tools.riscv32-esp-elf-gcc.path={runtime.platform.path}/tools/riscv32-esp-elf
9
9
tools.riscv32-esp-elf-gdb.path={runtime.platform.path}/tools/riscv32-esp-elf-gdb
10
10
11
- debug.server.openocd.path={runtime.platform.path}/tools/openocd-esp32/bin/openocd
12
- debug.server.openocd.scripts_dir={runtime.platform.path}/tools/openocd-esp32/share/openocd/scripts/
13
- debug.server.openocd.scripts_dir.windows={runtime.platform.path}\tools\openocd-esp32\share\openocd\scripts\
14
-
15
11
tools.esptool_py.path={runtime.platform.path}/tools/esptool
16
12
tools.esptool_py.cmd=esptool
17
13
tools.esptool_py.cmd.linux=esptool.py
@@ -152,17 +148,6 @@ build.extra_flags=-DESP32 -DCORE_DEBUG_LEVEL={build.code_debug} {build.loop_core
152
148
build.extra_libs=
153
149
build.memory_type={build.boot}_qspi
154
150
155
- # OpenOCD default configs
156
- build.copy_jtag_files=0
157
- build.openocdscript.esp32=esp32-wrover-kit-3.3v.cfg
158
- build.openocdscript.esp32s2=esp32s2-kaluga-1.cfg
159
- build.openocdscript.esp32s3=esp32s3-builtin.cfg
160
- build.openocdscript.esp32c3=esp32c3-builtin.cfg
161
- build.openocdscript={build.openocdscript.{build.mcu}}
162
-
163
- # Debug plugin configuration
164
- build.debugconfig={build.mcu}.json
165
-
166
151
# Custom build options
167
152
build.opt.name=build_opt.h
168
153
build.opt.path={build.path}/{build.opt.name}
@@ -199,18 +184,6 @@ recipe.hooks.prebuild.set_core_build_flag.pattern.windows=cmd /c type nul > "{fi
199
184
recipe.hooks.core.prebuild.set_core_build_flag.pattern.windows=cmd /c echo "-DARDUINO_CORE_BUILD" > "{file_opts.path}"
200
185
recipe.hooks.core.postbuild.set_core_build_flag.pattern.windows=cmd /c type nul > "{file_opts.path}"
201
186
202
- # Generate debug.cfg (must be postbuild)
203
- recipe.hooks.postbuild.1.pattern=/usr/bin/env bash -c "[ {build.copy_jtag_files} -eq 0 ] || cp -f "{debug.server.openocd.scripts_dir}"board/{build.openocdscript} "{build.source.path}"/debug.cfg"
204
- recipe.hooks.postbuild.1.pattern.windows=cmd /c IF {build.copy_jtag_files}==1 COPY /y "{debug.server.openocd.scripts_dir}board\{build.openocdscript}" "{build.source.path}\debug.cfg"
205
-
206
- # Generate debug_custom.json
207
- recipe.hooks.postbuild.2.pattern=/usr/bin/env bash -c "[ {build.copy_jtag_files} -eq 0 ] || cp -f "{runtime.platform.path}"/tools/ide-debug/{build.debugconfig} "{build.source.path}"/debug_custom.json"
208
- recipe.hooks.postbuild.2.pattern.windows=cmd /c IF {build.copy_jtag_files}==1 COPY /y "{runtime.platform.path}\tools\ide-debug\{build.debugconfig}" "{build.source.path}\debug_custom.json"
209
-
210
- # Generate chip.svd
211
- recipe.hooks.postbuild.3.pattern=/usr/bin/env bash -c "[ {build.copy_jtag_files} -eq 0 ] || cp -f "{runtime.platform.path}"/tools/ide-debug/svd/{build.mcu}.svd "{build.source.path}"/debug.svd"
212
- recipe.hooks.postbuild.3.pattern.windows=cmd /c IF {build.copy_jtag_files}==1 COPY /y "{runtime.platform.path}\tools\ide-debug\svd\{build.mcu}.svd" "{build.source.path}\debug.svd"
213
-
214
187
## Compile c files
215
188
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.c.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" -DARDUINO_VARIANT="{build.variant}" -DARDUINO_PARTITION_{build.partitions} {compiler.c.extra_flags} {build.extra_flags} "@{build.opt.path}" "@{file_opts.path}" {includes} "{source_file}" -o "{object_file}"
216
189
@@ -259,16 +232,74 @@ pluggable_monitor.required.serial=builtin:serial-monitor
259
232
## Upload/Debug tools
260
233
## ------------------
261
234
262
- # Debugger configuration (general options)
263
- # ----------------------------------------
264
- # EXPERIMENTAL feature:
265
- # - this is alpha and may be subject to change without notice
235
+ # Debugger configuration
236
+ # ----------------------
237
+
238
+ # ESP32 debug configuration
239
+ debug_script.esp32=esp32-wrover-kit-3.3v.cfg
240
+ debug_config.esp32.cortex-debug.custom.name=Arduino on ESP32
241
+ debug_config.esp32.cortex-debug.custom.postAttachCommands.0=set remote hardware-watchpoint-limit 2
242
+ debug_config.esp32.cortex-debug.custom.postAttachCommands.1=monitor reset halt
243
+ debug_config.esp32.cortex-debug.custom.postAttachCommands.2=monitor gdb_sync
244
+ debug_config.esp32.cortex-debug.custom.postAttachCommands.3=thb setup
245
+ debug_config.esp32.cortex-debug.custom.postAttachCommands.4=c
246
+ debug_config.esp32.cortex-debug.custom.overrideRestartCommands.0=monitor reset halt
247
+ debug_config.esp32.cortex-debug.custom.overrideRestartCommands.1=monitor gdb_sync
248
+ debug_config.esp32.cortex-debug.custom.overrideRestartCommands.2=thb setup
249
+ debug_config.esp32.cortex-debug.custom.overrideRestartCommands.3=c
250
+
251
+ # ESP32-S2 debug configuration
252
+ debug_script.esp32s2=esp32s2-kaluga-1.cfg
253
+ debug_config.esp32s2.cortex-debug.custom.name=Arduino on ESP32-S2
254
+ debug_config.esp32s2.cortex-debug.custom.postAttachCommands.0=set remote hardware-watchpoint-limit 2
255
+ debug_config.esp32s2.cortex-debug.custom.postAttachCommands.1=monitor reset halt
256
+ debug_config.esp32s2.cortex-debug.custom.postAttachCommands.2=monitor gdb_sync
257
+ debug_config.esp32s2.cortex-debug.custom.postAttachCommands.3=thb setup
258
+ debug_config.esp32s2.cortex-debug.custom.postAttachCommands.4=c
259
+ debug_config.esp32s2.cortex-debug.custom.overrideRestartCommands.0=monitor reset halt
260
+ debug_config.esp32s2.cortex-debug.custom.overrideRestartCommands.1=monitor gdb_sync
261
+ debug_config.esp32s2.cortex-debug.custom.overrideRestartCommands.2=thb setup
262
+ debug_config.esp32s2.cortex-debug.custom.overrideRestartCommands.3=c
263
+
264
+ # ESP32-S3 debug configuration
265
+ debug_script.esp32s3=esp32s3-builtin.cfg
266
+ debug_config.esp32s3.cortex-debug.custom.name=Arduino on ESP32-S3
267
+ debug_config.esp32s3.cortex-debug.custom.overrideAttachCommands.0=set remote hardware-watchpoint-limit 2
268
+ debug_config.esp32s3.cortex-debug.custom.overrideAttachCommands.1=monitor reset halt
269
+ debug_config.esp32s3.cortex-debug.custom.overrideAttachCommands.2=monitor gdb_sync
270
+ debug_config.esp32s3.cortex-debug.custom.overrideAttachCommands.3=thb setup
271
+ debug_config.esp32s3.cortex-debug.custom.overrideAttachCommands.4=c
272
+ debug_config.esp32s3.cortex-debug.custom.overrideRestartCommands.0=monitor reset halt
273
+ debug_config.esp32s3.cortex-debug.custom.overrideRestartCommands.1=monitor gdb_sync
274
+
275
+ # ESP32-C3 debug configuration
276
+ debug_script.esp32c3=esp32c3-builtin.cfg
277
+ debug_config.esp32c3.cortex-debug.custom.name=Arduino on ESP32-C3
278
+ debug_config.esp32c3.cortex-debug.custom.serverArgs.0=-d3
279
+ debug_config.esp32c3.cortex-debug.custom.overrideAttachCommands.0=set remote hardware-watchpoint-limit 8
280
+ debug_config.esp32c3.cortex-debug.custom.overrideAttachCommands.1=monitor reset
281
+ debug_config.esp32c3.cortex-debug.custom.overrideAttachCommands.2=monitor halt
282
+ debug_config.esp32c3.cortex-debug.custom.overrideAttachCommands.3=monitor gdb_sync
283
+ debug_config.esp32c3.cortex-debug.custom.overrideAttachCommands.4=thb setup
284
+ debug_config.esp32c3.cortex-debug.custom.overrideRestartCommands.0=monitor reset
285
+ debug_config.esp32c3.cortex-debug.custom.overrideRestartCommands.1=monitor halt
286
+ debug_config.esp32c3.cortex-debug.custom.overrideRestartCommands.2=monitor gdb_sync
287
+ debug_config.esp32c3.cortex-debug.custom.overrideRestartCommands.3=thb setup
288
+
289
+ # Debug API variable definitions
266
290
debug.executable={build.path}/{build.project_name}.elf
267
291
debug.toolchain=gcc
268
292
debug.toolchain.path={tools.{build.tarch}-esp-elf-gdb.path}/bin/
269
- debug.toolchain.prefix={build.tarch}-{build.target}-elf-
293
+ debug.toolchain.prefix={build.tarch}-{build.target}-elf
270
294
debug.server=openocd
271
- debug.server.openocd.script=debug.cfg
295
+ debug.server.openocd.path={runtime.platform.path}/tools/openocd-esp32/bin/openocd
296
+ debug.server.openocd.scripts_dir={runtime.platform.path}/tools/openocd-esp32/share/openocd/scripts/
297
+ debug.server.openocd.scripts_dir.windows={runtime.platform.path}\tools\openocd-esp32\share\openocd\scripts\
298
+ debug.server.openocd.scripts.0=board/{debug_script.{build.mcu}}
299
+ debug.svd_file={runtime.platform.path}/tools/ide-debug/svd/{build.mcu}.svd
300
+
301
+ debug.cortex-debug.custom.request=attach
302
+ debug.additional_config=debug_config.{build.mcu}
272
303
273
304
##
274
305
## ESPTool
0 commit comments