Skip to content

Commit 5b61930

Browse files
authored
Support JTAG debugging in Arduino IDE 2.0 (#7295)
* Add support for Arduino IDE 2.0 Debug * Update platform.txt * Add SVD support * Update configs for IDE 2.0.3 * Update esp32c3.json
1 parent e355370 commit 5b61930

17 files changed

+323471
-142
lines changed

.github/scripts/on-release.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,12 @@ cp -Rf "$GITHUB_WORKSPACE/libraries" "$PKG_DIR/"
179179
cp -Rf "$GITHUB_WORKSPACE/variants" "$PKG_DIR/"
180180
cp -f "$GITHUB_WORKSPACE/tools/espota.exe" "$PKG_DIR/tools/"
181181
cp -f "$GITHUB_WORKSPACE/tools/espota.py" "$PKG_DIR/tools/"
182-
cp -f "$GITHUB_WORKSPACE/tools/esptool.py" "$PKG_DIR/tools/"
183182
cp -f "$GITHUB_WORKSPACE/tools/gen_esp32part.py" "$PKG_DIR/tools/"
184183
cp -f "$GITHUB_WORKSPACE/tools/gen_esp32part.exe" "$PKG_DIR/tools/"
185184
cp -Rf "$GITHUB_WORKSPACE/tools/partitions" "$PKG_DIR/tools/"
185+
cp -Rf "$GITHUB_WORKSPACE/tools/ide-debug" "$PKG_DIR/tools/"
186186
cp -Rf "$GITHUB_WORKSPACE/tools/sdk" "$PKG_DIR/tools/"
187-
cp -f $GITHUB_WORKSPACE/tools/platformio-build*.py "$PKG_DIR/tools/"
187+
cp -f $GITHUB_WORKSPACE/tools/platformio-build*.py "$PKG_DIR/tools/"
188188

189189
# Remove unnecessary files in the package folder
190190
echo "Cleaning up folders ..."
@@ -197,7 +197,11 @@ cat "$GITHUB_WORKSPACE/platform.txt" | \
197197
sed "s/version=.*/version=$ver$extent/g" | \
198198
sed 's/runtime.tools.xtensa-esp32-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-esp32-elf//g' | \
199199
sed 's/runtime.tools.xtensa-esp32s2-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-esp32s2-elf//g' | \
200+
sed 's/runtime.tools.xtensa-esp32s3-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-esp32s3-elf//g' | \
201+
sed 's/runtime.tools.riscv32-esp-elf-gcc.path={runtime.platform.path}\/tools\/riscv32-esp-elf//g' | \
200202
sed 's/tools.esptool_py.path={runtime.platform.path}\/tools\/esptool/tools.esptool_py.path=\{runtime.tools.esptool_py.path\}/g' \
203+
sed 's/debug.server.openocd.path={runtime.platform.path}\/tools\/openocd-esp32\/bin\/openocd/debug.server.openocd.path=\{runtime.tools.openocd-esp32.path\}\/bin\/openocd/g' \
204+
sed 's/debug.server.openocd.scripts_dir={runtime.platform.path}\/tools\/openocd-esp32\/share\/openocd\/scripts\//debug.server.openocd.scripts_dir=\{runtime.tools.openocd-esp32.path\}\/share\/openocd\/scripts\//g' \
201205
> "$PKG_DIR/platform.txt"
202206

203207
# Add header with version information

.gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ tools/esptool.exe
88
tools/mkspiffs
99
tools/mklittlefs
1010
tools/mkfatfs.exe
11+
tools/openocd-esp32
1112

1213
# Ignore editor backup files and macOS system metadata
1314
.DS_Store
@@ -19,8 +20,8 @@ tools/mkfatfs.exe
1920
/build
2021

2122
# Ignore files built by Visual Studio/Visual Micro
22-
[Dd]ebug*/
23-
[Rr]elease*/
23+
[Dd]ebug/
24+
[Rr]elease/
2425
.vs/
2526
__vm/
2627
*.vcxproj*

boards.txt

+29
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ menu.LoopCore=Arduino Runs On
1818
menu.EventsCore=Events Run On
1919
menu.MemoryType=Memory Type
2020
menu.EraseFlash=Erase All Flash Before Sketch Upload
21+
menu.JTAGAdapter=JTAG Adapter
2122

2223
##############################################################
2324
### DO NOT PUT BOARDS ABOVE THE OFFICIAL ESPRESSIF BOARDS! ###
@@ -69,6 +70,14 @@ esp32s3.build.event_core=
6970
esp32s3.build.psram_type=qspi
7071
esp32s3.build.memory_type={build.boot}_{build.psram_type}
7172

73+
## IDE 2.0 Seems to not update the value
74+
esp32s3.menu.JTAGAdapter.default=Integrated USB JTAG
75+
esp32s3.menu.JTAGAdapter.default.build.openocdscript=esp32s3-builtin.cfg
76+
esp32s3.menu.JTAGAdapter.external=FTDI Adapter
77+
esp32s3.menu.JTAGAdapter.external.build.openocdscript=esp32s3-ftdi.cfg
78+
esp32s3.menu.JTAGAdapter.bridge=ESP USB Bridge
79+
esp32s3.menu.JTAGAdapter.bridge.build.openocdscript=esp32s3-bridge.cfg
80+
7281
esp32s3.menu.PSRAM.disabled=Disabled
7382
esp32s3.menu.PSRAM.disabled.build.defines=
7483
esp32s3.menu.PSRAM.disabled.build.psram_type=qspi
@@ -270,6 +279,14 @@ esp32c3.build.boot=qio
270279
esp32c3.build.partitions=default
271280
esp32c3.build.defines=
272281

282+
## IDE 2.0 Seems to not update the value
283+
esp32c3.menu.JTAGAdapter.default=Integrated USB JTAG
284+
esp32c3.menu.JTAGAdapter.default.build.openocdscript=esp32c3-builtin.cfg
285+
esp32c3.menu.JTAGAdapter.external=FTDI Adapter
286+
esp32c3.menu.JTAGAdapter.external.build.openocdscript=esp32c3-ftdi.cfg
287+
esp32c3.menu.JTAGAdapter.bridge=ESP USB Bridge
288+
esp32c3.menu.JTAGAdapter.bridge.build.openocdscript=esp32c3-bridge.cfg
289+
273290
esp32c3.menu.CDCOnBoot.default=Disabled
274291
esp32c3.menu.CDCOnBoot.default.build.cdc_on_boot=0
275292
esp32c3.menu.CDCOnBoot.cdc=Enabled
@@ -427,6 +444,12 @@ esp32s2.build.boot=qio
427444
esp32s2.build.partitions=default
428445
esp32s2.build.defines=
429446

447+
## IDE 2.0 Seems to not update the value
448+
esp32s2.menu.JTAGAdapter.external=FTDI Adapter
449+
esp32s2.menu.JTAGAdapter.external.build.openocdscript=esp32s2-kaluga-1.cfg
450+
esp32s2.menu.JTAGAdapter.bridge=ESP USB Bridge
451+
esp32s2.menu.JTAGAdapter.bridge.build.openocdscript=esp32s2-bridge.cfg
452+
430453
esp32s2.menu.CDCOnBoot.default=Disabled
431454
esp32s2.menu.CDCOnBoot.default.build.cdc_on_boot=0
432455
esp32s2.menu.CDCOnBoot.cdc=Enabled
@@ -603,6 +626,12 @@ esp32.build.defines=
603626
esp32.build.loop_core=
604627
esp32.build.event_core=
605628

629+
## IDE 2.0 Seems to not update the value
630+
esp32.menu.JTAGAdapter.external=FTDI Adapter
631+
esp32.menu.JTAGAdapter.external.build.openocdscript=esp32-wrover-kit-3.3v.cfg
632+
esp32.menu.JTAGAdapter.bridge=ESP USB Bridge
633+
esp32.menu.JTAGAdapter.bridge.build.openocdscript=esp32-bridge.cfg
634+
606635
esp32.menu.PSRAM.disabled=Disabled
607636
esp32.menu.PSRAM.disabled.build.defines=
608637
esp32.menu.PSRAM.disabled.build.extra_libs=

0 commit comments

Comments
 (0)