@@ -8,26 +8,22 @@ 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
18
14
tools.esptool_py.cmd.windows=esptool.exe
19
15
20
16
tools.esptool_py.network_cmd=python3 "{runtime.platform.path}/tools/espota.py" -r
21
- tools.esptool_py.network_cmd.windows="{runtime.platform.path}/ tools/ espota.exe" -r
17
+ tools.esptool_py.network_cmd.windows="{runtime.platform.path}\ tools\ espota.exe" -r
22
18
23
19
tools.esp_ota.cmd=python3 "{runtime.platform.path}/tools/espota.py" -r
24
- tools.esp_ota.cmd.windows="{runtime.platform.path}/ tools/ espota.exe" -r
20
+ tools.esp_ota.cmd.windows="{runtime.platform.path}\ tools\ espota.exe" -r
25
21
26
22
tools.gen_esp32part.cmd=python3 "{runtime.platform.path}/tools/gen_esp32part.py"
27
- tools.gen_esp32part.cmd.windows="{runtime.platform.path}/ tools/ gen_esp32part.exe"
23
+ tools.gen_esp32part.cmd.windows="{runtime.platform.path}\ tools\ gen_esp32part.exe"
28
24
29
25
tools.gen_insights_pkg.cmd=python3 "{runtime.platform.path}"/tools/gen_insights_package.py
30
- tools.gen_insights_pkg.cmd.windows="{runtime.platform.path}/ tools/ gen_insights_package.exe"
26
+ tools.gen_insights_pkg.cmd.windows="{runtime.platform.path}\ tools\ gen_insights_package.exe"
31
27
32
28
compiler.path={tools.{build.tarch}-{build.target}-elf-gcc.path}/bin/
33
29
compiler.sdk.path={runtime.platform.path}/tools/sdk/{build.mcu}
@@ -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}
@@ -180,7 +165,7 @@ recipe.hooks.prebuild.3.pattern.windows=cmd /c if not exist "{build.path}\partit
180
165
recipe.hooks.prebuild.4.pattern_args=--chip {build.mcu} elf2image --flash_mode {build.flash_mode} --flash_freq {build.flash_freq} --flash_size {build.flash_size} -o
181
166
recipe.hooks.prebuild.4.pattern=/usr/bin/env bash -c "[ -f "{build.source.path}"/bootloader.bin ] && cp -f "{build.source.path}"/bootloader.bin "{build.path}"/{build.project_name}.bootloader.bin || ( [ -f "{build.variant.path}"/{build.custom_bootloader}.bin ] && cp "{build.variant.path}"/{build.custom_bootloader}.bin "{build.path}"/{build.project_name}.bootloader.bin || "{tools.esptool_py.path}"/{tools.esptool_py.cmd} {recipe.hooks.prebuild.4.pattern_args} "{build.path}"/{build.project_name}.bootloader.bin "{compiler.sdk.path}"/bin/bootloader_{build.boot}_{build.boot_freq}.elf )"
182
167
recipe.hooks.prebuild.4.pattern.linux=/usr/bin/env bash -c "[ -f "{build.source.path}"/bootloader.bin ] && cp -f "{build.source.path}"/bootloader.bin "{build.path}"/{build.project_name}.bootloader.bin || ( [ -f "{build.variant.path}"/{build.custom_bootloader}.bin ] && cp "{build.variant.path}"/{build.custom_bootloader}.bin "{build.path}"/{build.project_name}.bootloader.bin || python3 "{tools.esptool_py.path}"/{tools.esptool_py.cmd} {recipe.hooks.prebuild.4.pattern_args} "{build.path}"/{build.project_name}.bootloader.bin "{compiler.sdk.path}"/bin/bootloader_{build.boot}_{build.boot_freq}.elf )"
183
- recipe.hooks.prebuild.4.pattern.windows=cmd /c IF EXIST "{build.source.path}\bootloader.bin" ( COPY /y "{build.source.path}\bootloader.bin" "{build.path}\{build.project_name}.bootloader.bin" ) ELSE ( IF EXIST "{build.variant.path}\{build.custom_bootloader}.bin" ( COPY "{build.variant.path}\{build.custom_bootloader}.bin" "{build.path}\{build.project_name}.bootloader.bin" ) ELSE ( "{tools.esptool_py.path}/ {tools.esptool_py.cmd}" {recipe.hooks.prebuild.4.pattern_args} "{build.path}\{build.project_name}.bootloader.bin" "{runtime.platform.path}\tools\sdk\{build.mcu}\bin\bootloader_{build.boot}_{build.boot_freq}.elf" ) )
168
+ recipe.hooks.prebuild.4.pattern.windows=cmd /c IF EXIST "{build.source.path}\bootloader.bin" ( COPY /y "{build.source.path}\bootloader.bin" "{build.path}\{build.project_name}.bootloader.bin" ) ELSE ( IF EXIST "{build.variant.path}\{build.custom_bootloader}.bin" ( COPY "{build.variant.path}\{build.custom_bootloader}.bin" "{build.path}\{build.project_name}.bootloader.bin" ) ELSE ( "{tools.esptool_py.path}\ {tools.esptool_py.cmd}" {recipe.hooks.prebuild.4.pattern_args} "{build.path}\{build.project_name}.bootloader.bin" "{runtime.platform.path}\tools\sdk\{build.mcu}\bin\bootloader_{build.boot}_{build.boot_freq}.elf" ) )
184
169
185
170
# Check if custom build options exist in the sketch folder
186
171
recipe.hooks.prebuild.5.pattern=/usr/bin/env bash -c "[ ! -f "{build.source.path}"/build_opt.h ] || cp -f "{build.source.path}"/build_opt.h "{build.path}"/build_opt.h"
@@ -199,18 +184,6 @@ recipe.hooks.prebuild.7.pattern.windows=cmd /c type nul > "{file_opts.path}"
199
184
recipe.hooks.core.prebuild.1.pattern.windows=cmd /c echo "-DARDUINO_CORE_BUILD" > "{file_opts.path}"
200
185
recipe.hooks.core.postbuild.1.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,76 @@ 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
+ # Enabling globals causes a crash within the Cortex-Debug extension with 2.x libraries
302
+ # debug.cortex-debug.custom.objdumpPath={compiler.path}{compiler.prefix}objdump
303
+ debug.cortex-debug.custom.request=attach
304
+ debug.additional_config=debug_config.{build.mcu}
272
305
273
306
##
274
307
## ESPTool
0 commit comments