Implement official Arduino IDE debugger API (#9116)
* refactor(on-release): improve platform.txt path replacements
Use regexs to replace all occurrences of `{runtime.platform.path}` with
the correct `{runtime.tools.*.path}`, regardless of directory separator,
and remove dependency on specific text around each path.
Note that the order has been changed to ensure that the longest paths
are replaced first, to avoid replacing parts of other paths.
* fix(platform): Windows backslash cleanups
Ensure Windows paths properly use a backslash as folder separator.
* feat(platform)!: use new Arduino Debug API
Implement sketch debugging according to the official Arduino
Platform Debug Specification [1].
The biggest improvement is that now `launch.json` can be fully
customized by the core (including the type of each entry),
so there is no need to copy files in the sketch folder.
In particular, `debug_custom.json` is not used anymore.
[1] https://arduino.github.io/arduino-cli/latest/platform-specification/#sketch-debugging-configuration
BREAKING CHANGE: This commit requires Arduino IDE 2.3.0 or later to use
the debugging features. Older versions will no longer be able to start
a debug session successfully.
* feat(debug): pass objdump path to resolve globals
Cortex-debug requires objdump to be in the same folder as gdb, or needs
the full path to the executable in the `launch.json` file. This is now
possible with the new debugging API.
* feat(debug): conditionally enable debug button on Nano ESP32
If the `debug.executable` variable is null or unset, the Debug button
appears grayed out. The new IDE also takes current parameters into
account, allowing to conditionally enable the Debug button only when
some conditions are met.
* on_release: allow single board packages
---------
Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
This commit is contained in:
parent
c21a8cdaa5
commit
7a22d64be2
8 changed files with 128 additions and 151 deletions
47
.github/scripts/on-release.sh
vendored
47
.github/scripts/on-release.sh
vendored
|
|
@ -35,6 +35,12 @@ echo "Event: $GITHUB_EVENT_NAME, Repo: $GITHUB_REPOSITORY, Path: $GITHUB_WORKSPA
|
||||||
echo "Action: $action, Branch: $RELEASE_BRANCH, ID: $RELEASE_ID"
|
echo "Action: $action, Branch: $RELEASE_BRANCH, ID: $RELEASE_ID"
|
||||||
echo "Tag: $RELEASE_TAG, Draft: $draft, Pre-Release: $RELEASE_PRE"
|
echo "Tag: $RELEASE_TAG, Draft: $draft, Pre-Release: $RELEASE_PRE"
|
||||||
|
|
||||||
|
# Try extracting something like a JSON with a "boards" array/element and "vendor" fields
|
||||||
|
BOARDS=`echo $RELEASE_BODY | grep -Pzo '(?s){.*}' | jq -r '.boards[]? // .boards? // empty' | xargs echo -n 2>/dev/null`
|
||||||
|
VENDOR=`echo $RELEASE_BODY | grep -Pzo '(?s){.*}' | jq -r '.vendor? // empty' | xargs echo -n 2>/dev/null`
|
||||||
|
if ! [ -z "${BOARDS}" ]; then echo "Releasing board(s): $BOARDS" ; fi
|
||||||
|
if ! [ -z "${VENDOR}" ]; then echo "Setting packager: $VENDOR" ; fi
|
||||||
|
|
||||||
function get_file_size(){
|
function get_file_size(){
|
||||||
local file="$1"
|
local file="$1"
|
||||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
|
|
@ -170,12 +176,26 @@ mkdir -p "$PKG_DIR/tools"
|
||||||
|
|
||||||
# Copy all core files to the package folder
|
# Copy all core files to the package folder
|
||||||
echo "Copying files for packaging ..."
|
echo "Copying files for packaging ..."
|
||||||
|
if [ -z "${BOARDS}" ]; then
|
||||||
|
# Copy all variants
|
||||||
cp -f "$GITHUB_WORKSPACE/boards.txt" "$PKG_DIR/"
|
cp -f "$GITHUB_WORKSPACE/boards.txt" "$PKG_DIR/"
|
||||||
|
cp -Rf "$GITHUB_WORKSPACE/variants" "$PKG_DIR/"
|
||||||
|
else
|
||||||
|
# Remove all entries not starting with any board code or "menu." from boards.txt
|
||||||
|
cat "$GITHUB_WORKSPACE/boards.txt" | grep "^menu\." > "$PKG_DIR/boards.txt"
|
||||||
|
for board in ${BOARDS} ; do
|
||||||
|
cat "$GITHUB_WORKSPACE/boards.txt" | grep "^${board}\." >> "$PKG_DIR/boards.txt"
|
||||||
|
done
|
||||||
|
# Copy only relevant variant files
|
||||||
|
mkdir "$PKG_DIR/variants/"
|
||||||
|
for variant in `cat ${PKG_DIR}/boards.txt | grep "\.variant=" | cut -d= -f2` ; do
|
||||||
|
cp -Rf "$GITHUB_WORKSPACE/variants/${variant}" "$PKG_DIR/variants/"
|
||||||
|
done
|
||||||
|
fi
|
||||||
cp -f "$GITHUB_WORKSPACE/package.json" "$PKG_DIR/"
|
cp -f "$GITHUB_WORKSPACE/package.json" "$PKG_DIR/"
|
||||||
cp -f "$GITHUB_WORKSPACE/programmers.txt" "$PKG_DIR/"
|
cp -f "$GITHUB_WORKSPACE/programmers.txt" "$PKG_DIR/"
|
||||||
cp -Rf "$GITHUB_WORKSPACE/cores" "$PKG_DIR/"
|
cp -Rf "$GITHUB_WORKSPACE/cores" "$PKG_DIR/"
|
||||||
cp -Rf "$GITHUB_WORKSPACE/libraries" "$PKG_DIR/"
|
cp -Rf "$GITHUB_WORKSPACE/libraries" "$PKG_DIR/"
|
||||||
cp -Rf "$GITHUB_WORKSPACE/variants" "$PKG_DIR/"
|
|
||||||
cp -f "$GITHUB_WORKSPACE/tools/espota.exe" "$PKG_DIR/tools/"
|
cp -f "$GITHUB_WORKSPACE/tools/espota.exe" "$PKG_DIR/tools/"
|
||||||
cp -f "$GITHUB_WORKSPACE/tools/espota.py" "$PKG_DIR/tools/"
|
cp -f "$GITHUB_WORKSPACE/tools/espota.py" "$PKG_DIR/tools/"
|
||||||
cp -f "$GITHUB_WORKSPACE/tools/gen_esp32part.py" "$PKG_DIR/tools/"
|
cp -f "$GITHUB_WORKSPACE/tools/gen_esp32part.py" "$PKG_DIR/tools/"
|
||||||
|
|
@ -201,19 +221,22 @@ RVTC_NEW_NAME="esp-rv32"
|
||||||
echo "Generating platform.txt..."
|
echo "Generating platform.txt..."
|
||||||
cat "$GITHUB_WORKSPACE/platform.txt" | \
|
cat "$GITHUB_WORKSPACE/platform.txt" | \
|
||||||
sed "s/version=.*/version=$RELEASE_TAG/g" | \
|
sed "s/version=.*/version=$RELEASE_TAG/g" | \
|
||||||
sed 's/tools.esp32-arduino-libs.path={runtime.platform.path}\/tools\/esp32-arduino-libs/tools.esp32-arduino-libs.path=\{runtime.tools.esp32-arduino-libs.path\}/g' | \
|
sed 's/{runtime\.platform\.path}.tools.esp32-arduino-libs/\{runtime.tools.esp32-arduino-libs.path\}/g' | \
|
||||||
sed 's/tools.xtensa-esp32-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-esp32-elf/tools.xtensa-esp32-elf-gcc.path=\{runtime.tools.xtensa-esp32-elf-gcc.path\}/g' | \
|
sed 's/{runtime\.platform\.path}.tools.xtensa-esp-elf-gdb/\{runtime.tools.xtensa-esp-elf-gdb.path\}/g' | \
|
||||||
sed 's/tools.xtensa-esp32s2-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-esp32s2-elf/tools.xtensa-esp32s2-elf-gcc.path=\{runtime.tools.xtensa-esp32s2-elf-gcc.path\}/g' | \
|
sed 's/{runtime\.platform\.path}.tools.xtensa-esp32-elf/\{runtime.tools.xtensa-esp32-elf-gcc.path\}/g' | \
|
||||||
sed 's/tools.xtensa-esp32s3-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-esp32s3-elf/tools.xtensa-esp32s3-elf-gcc.path=\{runtime.tools.xtensa-esp32s3-elf-gcc.path\}/g' | \
|
sed 's/{runtime\.platform\.path}.tools.xtensa-esp32s2-elf/\{runtime.tools.xtensa-esp32s2-elf-gcc.path\}/g' | \
|
||||||
sed 's/tools.xtensa-esp-elf-gdb.path={runtime.platform.path}\/tools\/xtensa-esp-elf-gdb/tools.xtensa-esp-elf-gdb.path=\{runtime.tools.xtensa-esp-elf-gdb.path\}/g' | \
|
sed 's/{runtime\.platform\.path}.tools.xtensa-esp32s3-elf/\{runtime.tools.xtensa-esp32s3-elf-gcc.path\}/g' | \
|
||||||
sed "s/tools.riscv32-esp-elf-gcc.path={runtime.platform.path}\\/tools\\/riscv32-esp-elf/tools.riscv32-esp-elf-gcc.path=\\{runtime.tools.$RVTC_NEW_NAME.path\\}/g" | \
|
sed 's/{runtime\.platform\.path}.tools.riscv32-esp-elf-gdb/\{runtime.tools.riscv32-esp-elf-gdb.path\}/g' | \
|
||||||
sed 's/tools.riscv32-esp-elf-gdb.path={runtime.platform.path}\/tools\/riscv32-esp-elf-gdb/tools.riscv32-esp-elf-gdb.path=\{runtime.tools.riscv32-esp-elf-gdb.path\}/g' | \
|
sed "s/{runtime\.platform\.path}.tools.riscv32-esp-elf/\\{runtime.tools.$RVTC_NEW_NAME.path\\}/g" | \
|
||||||
sed 's/tools.esptool_py.path={runtime.platform.path}\/tools\/esptool/tools.esptool_py.path=\{runtime.tools.esptool_py.path\}/g' | \
|
sed 's/{runtime\.platform\.path}.tools.esptool/\{runtime.tools.esptool_py.path\}/g' | \
|
||||||
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' | \
|
sed 's/{runtime\.platform\.path}.tools.openocd-esp32/\{runtime.tools.openocd-esp32.path\}/g' \
|
||||||
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' | \
|
|
||||||
sed 's/debug.server.openocd.scripts_dir.windows={runtime.platform.path}\\tools\\openocd-esp32\\share\\openocd\\scripts\\/debug.server.openocd.scripts_dir.windows=\{runtime.tools.openocd-esp32.path\}\\share\\openocd\\scripts\\/g' \
|
|
||||||
> "$PKG_DIR/platform.txt"
|
> "$PKG_DIR/platform.txt"
|
||||||
|
|
||||||
|
if ! [ -z ${VENDOR} ]; then
|
||||||
|
# Append vendor name to platform.txt to create a separate section
|
||||||
|
sed -i "/^name=.*/s/$/ ($VENDOR)/" "$PKG_DIR/platform.txt"
|
||||||
|
fi
|
||||||
|
|
||||||
# Add header with version information
|
# Add header with version information
|
||||||
echo "Generating core_version.h ..."
|
echo "Generating core_version.h ..."
|
||||||
ver_define=`echo $RELEASE_TAG | tr "[:lower:].\055" "[:upper:]_"`
|
ver_define=`echo $RELEASE_TAG | tr "[:lower:].\055" "[:upper:]_"`
|
||||||
|
|
|
||||||
17
boards.txt
17
boards.txt
|
|
@ -33459,9 +33459,22 @@ nano_nora.build.psram_type=opi
|
||||||
nano_nora.build.memory_type={build.boot}_{build.psram_type}
|
nano_nora.build.memory_type={build.boot}_{build.psram_type}
|
||||||
nano_nora.build.disable_pin_remap=
|
nano_nora.build.disable_pin_remap=
|
||||||
|
|
||||||
|
nano_nora.debug_config.nano_nora.cortex-debug.custom.name=Arduino on Nano ESP32
|
||||||
|
nano_nora.debug_config.nano_nora.cortex-debug.custom.overrideAttachCommands.0=set remote hardware-watchpoint-limit 2
|
||||||
|
nano_nora.debug_config.nano_nora.cortex-debug.custom.overrideAttachCommands.1=monitor reset halt
|
||||||
|
nano_nora.debug_config.nano_nora.cortex-debug.custom.overrideAttachCommands.2=monitor gdb_sync
|
||||||
|
nano_nora.debug_config.nano_nora.cortex-debug.custom.overrideAttachCommands.3=interrupt
|
||||||
|
nano_nora.debug_config.nano_nora.cortex-debug.custom.overrideRestartCommands.0=monitor reset halt
|
||||||
|
nano_nora.debug_config.nano_nora.cortex-debug.custom.overrideRestartCommands.1=monitor gdb_sync
|
||||||
|
nano_nora.debug_config.nano_nora.cortex-debug.custom.overrideRestartCommands.2=interrupt
|
||||||
|
nano_nora.debug.additional_config=debug_config.nano_nora
|
||||||
|
|
||||||
nano_nora.tools.esptool_py.program.pattern_args=--chip {build.mcu} --port "{serial.port}" --before default_reset --after hard_reset write_flash -z --flash_mode {build.flash_mode} --flash_freq {build.flash_freq} --flash_size {build.flash_size} {build.bootloader_addr} "{build.path}/{build.project_name}.bootloader.bin" 0x8000 "{build.path}/{build.project_name}.partitions.bin" 0xe000 "{runtime.platform.path}/tools/partitions/boot_app0.bin" 0xf70000 "{build.variant.path}/extra/nora_recovery/nora_recovery.ino.bin" 0x10000 "{build.path}/{build.project_name}.bin"
|
nano_nora.tools.esptool_py.program.pattern_args=--chip {build.mcu} --port "{serial.port}" --before default_reset --after hard_reset write_flash -z --flash_mode {build.flash_mode} --flash_freq {build.flash_freq} --flash_size {build.flash_size} {build.bootloader_addr} "{build.path}/{build.project_name}.bootloader.bin" 0x8000 "{build.path}/{build.project_name}.partitions.bin" 0xe000 "{runtime.platform.path}/tools/partitions/boot_app0.bin" 0xf70000 "{build.variant.path}/extra/nora_recovery/nora_recovery.ino.bin" 0x10000 "{build.path}/{build.project_name}.bin"
|
||||||
nano_nora.tools.esptool_py.erase.pattern_args=--chip {build.mcu} --port "{serial.port}" --before default_reset --after hard_reset erase_flash
|
nano_nora.tools.esptool_py.erase.pattern_args=--chip {build.mcu} --port "{serial.port}" --before default_reset --after hard_reset erase_flash
|
||||||
|
|
||||||
|
nano_nora.programmer.default=esptool
|
||||||
|
nano_nora.debug.executable=
|
||||||
|
|
||||||
nano_nora.menu.PartitionScheme.default=With FAT partition (default)
|
nano_nora.menu.PartitionScheme.default=With FAT partition (default)
|
||||||
nano_nora.menu.PartitionScheme.spiffs=With SPIFFS partition (advanced)
|
nano_nora.menu.PartitionScheme.spiffs=With SPIFFS partition (advanced)
|
||||||
nano_nora.menu.PartitionScheme.spiffs.build.partitions=app3M_spiffs9M_fact512k_16MB
|
nano_nora.menu.PartitionScheme.spiffs.build.partitions=app3M_spiffs9M_fact512k_16MB
|
||||||
|
|
@ -33473,9 +33486,7 @@ nano_nora.menu.PinNumbers.byGPIONumber.build.disable_pin_remap=-DBOARD_USES_HW_G
|
||||||
nano_nora.menu.USBMode.default=Normal mode (TinyUSB)
|
nano_nora.menu.USBMode.default=Normal mode (TinyUSB)
|
||||||
nano_nora.menu.USBMode.hwcdc=Debug mode (Hardware CDC)
|
nano_nora.menu.USBMode.hwcdc=Debug mode (Hardware CDC)
|
||||||
nano_nora.menu.USBMode.hwcdc.build.usb_mode=1
|
nano_nora.menu.USBMode.hwcdc.build.usb_mode=1
|
||||||
nano_nora.menu.USBMode.hwcdc.build.copy_jtag_files=1
|
nano_nora.menu.USBMode.hwcdc.debug.executable={build.path}/{build.project_name}.elf
|
||||||
nano_nora.menu.USBMode.hwcdc.build.openocdscript=esp32s3-builtin.cfg
|
|
||||||
nano_nora.menu.USBMode.hwcdc.build.debugconfig=esp32s3-arduino.json
|
|
||||||
|
|
||||||
##############################################################
|
##############################################################
|
||||||
|
|
||||||
|
|
|
||||||
118
platform.txt
118
platform.txt
|
|
@ -9,26 +9,22 @@ tools.xtensa-esp-elf-gdb.path={runtime.platform.path}/tools/xtensa-esp-elf-gdb
|
||||||
tools.riscv32-esp-elf-gcc.path={runtime.platform.path}/tools/riscv32-esp-elf
|
tools.riscv32-esp-elf-gcc.path={runtime.platform.path}/tools/riscv32-esp-elf
|
||||||
tools.riscv32-esp-elf-gdb.path={runtime.platform.path}/tools/riscv32-esp-elf-gdb
|
tools.riscv32-esp-elf-gdb.path={runtime.platform.path}/tools/riscv32-esp-elf-gdb
|
||||||
|
|
||||||
debug.server.openocd.path={runtime.platform.path}/tools/openocd-esp32/bin/openocd
|
|
||||||
debug.server.openocd.scripts_dir={runtime.platform.path}/tools/openocd-esp32/share/openocd/scripts/
|
|
||||||
debug.server.openocd.scripts_dir.windows={runtime.platform.path}\tools\openocd-esp32\share\openocd\scripts\
|
|
||||||
|
|
||||||
tools.esptool_py.path={runtime.platform.path}/tools/esptool
|
tools.esptool_py.path={runtime.platform.path}/tools/esptool
|
||||||
tools.esptool_py.cmd=esptool
|
tools.esptool_py.cmd=esptool
|
||||||
tools.esptool_py.cmd.linux=esptool.py
|
tools.esptool_py.cmd.linux=esptool.py
|
||||||
tools.esptool_py.cmd.windows=esptool.exe
|
tools.esptool_py.cmd.windows=esptool.exe
|
||||||
|
|
||||||
tools.esptool_py.network_cmd=python3 "{runtime.platform.path}/tools/espota.py" -r
|
tools.esptool_py.network_cmd=python3 "{runtime.platform.path}/tools/espota.py" -r
|
||||||
tools.esptool_py.network_cmd.windows="{runtime.platform.path}/tools/espota.exe" -r
|
tools.esptool_py.network_cmd.windows="{runtime.platform.path}\tools\espota.exe" -r
|
||||||
|
|
||||||
tools.esp_ota.cmd=python3 "{runtime.platform.path}/tools/espota.py" -r
|
tools.esp_ota.cmd=python3 "{runtime.platform.path}/tools/espota.py" -r
|
||||||
tools.esp_ota.cmd.windows="{runtime.platform.path}/tools/espota.exe" -r
|
tools.esp_ota.cmd.windows="{runtime.platform.path}\tools\espota.exe" -r
|
||||||
|
|
||||||
tools.gen_esp32part.cmd=python3 "{runtime.platform.path}/tools/gen_esp32part.py"
|
tools.gen_esp32part.cmd=python3 "{runtime.platform.path}/tools/gen_esp32part.py"
|
||||||
tools.gen_esp32part.cmd.windows="{runtime.platform.path}/tools/gen_esp32part.exe"
|
tools.gen_esp32part.cmd.windows="{runtime.platform.path}\tools\gen_esp32part.exe"
|
||||||
|
|
||||||
tools.gen_insights_pkg.cmd=python3 "{runtime.platform.path}"/tools/gen_insights_package.py
|
tools.gen_insights_pkg.cmd=python3 "{runtime.platform.path}"/tools/gen_insights_package.py
|
||||||
tools.gen_insights_pkg.cmd.windows="{runtime.platform.path}/tools/gen_insights_package.exe"
|
tools.gen_insights_pkg.cmd.windows="{runtime.platform.path}\tools\gen_insights_package.exe"
|
||||||
|
|
||||||
compiler.path={tools.{build.tarch}-{build.target}-elf-gcc.path}/bin/
|
compiler.path={tools.{build.tarch}-{build.target}-elf-gcc.path}/bin/
|
||||||
compiler.prefix={build.tarch}-{build.target}-elf-
|
compiler.prefix={build.tarch}-{build.target}-elf-
|
||||||
|
|
@ -105,19 +101,6 @@ build.extra_flags=-DARDUINO_HOST_OS="{runtime.os}" -DARDUINO_FQBN="{build.fqbn}"
|
||||||
build.extra_libs=
|
build.extra_libs=
|
||||||
build.memory_type={build.boot}_qspi
|
build.memory_type={build.boot}_qspi
|
||||||
|
|
||||||
# OpenOCD default configs
|
|
||||||
build.copy_jtag_files=0
|
|
||||||
build.openocdscript.esp32=esp32-wrover-kit-3.3v.cfg
|
|
||||||
build.openocdscript.esp32s2=esp32s2-kaluga-1.cfg
|
|
||||||
build.openocdscript.esp32s3=esp32s3-builtin.cfg
|
|
||||||
build.openocdscript.esp32c3=esp32c3-builtin.cfg
|
|
||||||
build.openocdscript.esp32c6=esp32c6-builtin.cfg
|
|
||||||
build.openocdscript.esp32c6=esp32h2-builtin.cfg
|
|
||||||
build.openocdscript={build.openocdscript.{build.mcu}}
|
|
||||||
|
|
||||||
# Debug plugin configuration
|
|
||||||
build.debugconfig={build.mcu}.json
|
|
||||||
|
|
||||||
# Custom build options
|
# Custom build options
|
||||||
build.opt.name=build_opt.h
|
build.opt.name=build_opt.h
|
||||||
build.opt.path={build.path}/{build.opt.name}
|
build.opt.path={build.path}/{build.opt.name}
|
||||||
|
|
@ -135,7 +118,7 @@ recipe.hooks.prebuild.3.pattern.windows=cmd /c if not exist "{build.path}\partit
|
||||||
recipe.hooks.prebuild.4.pattern_args=--chip {build.mcu} elf2image --flash_mode {build.flash_mode} --flash_freq {build.img_freq} --flash_size {build.flash_size} -o
|
recipe.hooks.prebuild.4.pattern_args=--chip {build.mcu} elf2image --flash_mode {build.flash_mode} --flash_freq {build.img_freq} --flash_size {build.flash_size} -o
|
||||||
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 )"
|
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 )"
|
||||||
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 )"
|
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 )"
|
||||||
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" "{compiler.sdk.path}\bin\bootloader_{build.boot}_{build.boot_freq}.elf" ) )
|
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" "{compiler.sdk.path}\bin\bootloader_{build.boot}_{build.boot_freq}.elf" ) )
|
||||||
|
|
||||||
# Check if custom build options exist in the sketch folder
|
# Check if custom build options exist in the sketch folder
|
||||||
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"
|
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"
|
||||||
|
|
@ -154,18 +137,6 @@ recipe.hooks.prebuild.7.pattern.windows=cmd /c type nul > "{file_opts.path}"
|
||||||
recipe.hooks.core.prebuild.1.pattern.windows=cmd /c echo "-DARDUINO_CORE_BUILD" > "{file_opts.path}"
|
recipe.hooks.core.prebuild.1.pattern.windows=cmd /c echo "-DARDUINO_CORE_BUILD" > "{file_opts.path}"
|
||||||
recipe.hooks.core.postbuild.1.pattern.windows=cmd /c type nul > "{file_opts.path}"
|
recipe.hooks.core.postbuild.1.pattern.windows=cmd /c type nul > "{file_opts.path}"
|
||||||
|
|
||||||
# Generate debug.cfg (must be postbuild)
|
|
||||||
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"
|
|
||||||
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"
|
|
||||||
|
|
||||||
# Generate debug_custom.json
|
|
||||||
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"
|
|
||||||
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"
|
|
||||||
|
|
||||||
# Generate chip.svd
|
|
||||||
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"
|
|
||||||
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"
|
|
||||||
|
|
||||||
## Compile c files
|
## Compile c files
|
||||||
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.extra_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} {build.extra_flags} {compiler.cpreprocessor.flags} {includes} "@{build.opt.path}" "@{file_opts.path}" "{source_file}" -o "{object_file}"
|
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.extra_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} {build.extra_flags} {compiler.cpreprocessor.flags} {includes} "@{build.opt.path}" "@{file_opts.path}" "{source_file}" -o "{object_file}"
|
||||||
|
|
||||||
|
|
@ -217,16 +188,83 @@ pluggable_monitor.required.serial=builtin:serial-monitor
|
||||||
## Upload/Debug tools
|
## Upload/Debug tools
|
||||||
## ------------------
|
## ------------------
|
||||||
|
|
||||||
# Debugger configuration (general options)
|
# Debugger configuration
|
||||||
# ----------------------------------------
|
# ----------------------
|
||||||
# EXPERIMENTAL feature:
|
|
||||||
# - this is alpha and may be subject to change without notice
|
# ESP32 debug configuration
|
||||||
|
debug_script.esp32=esp32-wrover-kit-3.3v.cfg
|
||||||
|
debug_config.esp32.cortex-debug.custom.name=Arduino on ESP32
|
||||||
|
debug_config.esp32.cortex-debug.custom.postAttachCommands.0=set remote hardware-watchpoint-limit 2
|
||||||
|
debug_config.esp32.cortex-debug.custom.postAttachCommands.1=monitor reset halt
|
||||||
|
debug_config.esp32.cortex-debug.custom.postAttachCommands.2=monitor gdb_sync
|
||||||
|
debug_config.esp32.cortex-debug.custom.postAttachCommands.3=thb setup
|
||||||
|
debug_config.esp32.cortex-debug.custom.postAttachCommands.4=c
|
||||||
|
debug_config.esp32.cortex-debug.custom.overrideRestartCommands.0=monitor reset halt
|
||||||
|
debug_config.esp32.cortex-debug.custom.overrideRestartCommands.1=monitor gdb_sync
|
||||||
|
debug_config.esp32.cortex-debug.custom.overrideRestartCommands.2=thb setup
|
||||||
|
debug_config.esp32.cortex-debug.custom.overrideRestartCommands.3=c
|
||||||
|
|
||||||
|
# ESP32-S2 debug configuration
|
||||||
|
debug_script.esp32s2=esp32s2-kaluga-1.cfg
|
||||||
|
debug_config.esp32s2.cortex-debug.custom.name=Arduino on ESP32-S2
|
||||||
|
debug_config.esp32s2.cortex-debug.custom.postAttachCommands.0=set remote hardware-watchpoint-limit 2
|
||||||
|
debug_config.esp32s2.cortex-debug.custom.postAttachCommands.1=monitor reset halt
|
||||||
|
debug_config.esp32s2.cortex-debug.custom.postAttachCommands.2=monitor gdb_sync
|
||||||
|
debug_config.esp32s2.cortex-debug.custom.postAttachCommands.3=thb setup
|
||||||
|
debug_config.esp32s2.cortex-debug.custom.postAttachCommands.4=c
|
||||||
|
debug_config.esp32s2.cortex-debug.custom.overrideRestartCommands.0=monitor reset halt
|
||||||
|
debug_config.esp32s2.cortex-debug.custom.overrideRestartCommands.1=monitor gdb_sync
|
||||||
|
debug_config.esp32s2.cortex-debug.custom.overrideRestartCommands.2=thb setup
|
||||||
|
debug_config.esp32s2.cortex-debug.custom.overrideRestartCommands.3=c
|
||||||
|
|
||||||
|
# ESP32-S3 debug configuration
|
||||||
|
debug_script.esp32s3=esp32s3-builtin.cfg
|
||||||
|
debug_config.esp32s3.cortex-debug.custom.name=Arduino on ESP32-S3
|
||||||
|
debug_config.esp32s3.cortex-debug.custom.overrideAttachCommands.0=set remote hardware-watchpoint-limit 2
|
||||||
|
debug_config.esp32s3.cortex-debug.custom.overrideAttachCommands.1=monitor reset halt
|
||||||
|
debug_config.esp32s3.cortex-debug.custom.overrideAttachCommands.2=monitor gdb_sync
|
||||||
|
debug_config.esp32s3.cortex-debug.custom.overrideAttachCommands.3=thb setup
|
||||||
|
debug_config.esp32s3.cortex-debug.custom.overrideAttachCommands.4=c
|
||||||
|
debug_config.esp32s3.cortex-debug.custom.overrideRestartCommands.0=monitor reset halt
|
||||||
|
debug_config.esp32s3.cortex-debug.custom.overrideRestartCommands.1=monitor gdb_sync
|
||||||
|
|
||||||
|
# ESP32-C3 debug configuration
|
||||||
|
debug_script.esp32c3=esp32c3-builtin.cfg
|
||||||
|
debug_config.esp32c3.cortex-debug.custom.name=Arduino on ESP32-C3
|
||||||
|
debug_config.esp32c3.cortex-debug.custom.serverArgs.0=-d3
|
||||||
|
debug_config.esp32c3.cortex-debug.custom.overrideAttachCommands.0=set remote hardware-watchpoint-limit 8
|
||||||
|
debug_config.esp32c3.cortex-debug.custom.overrideAttachCommands.1=monitor reset
|
||||||
|
debug_config.esp32c3.cortex-debug.custom.overrideAttachCommands.2=monitor halt
|
||||||
|
debug_config.esp32c3.cortex-debug.custom.overrideAttachCommands.3=monitor gdb_sync
|
||||||
|
debug_config.esp32c3.cortex-debug.custom.overrideAttachCommands.4=thb setup
|
||||||
|
debug_config.esp32c3.cortex-debug.custom.overrideRestartCommands.0=monitor reset
|
||||||
|
debug_config.esp32c3.cortex-debug.custom.overrideRestartCommands.1=monitor halt
|
||||||
|
debug_config.esp32c3.cortex-debug.custom.overrideRestartCommands.2=monitor gdb_sync
|
||||||
|
debug_config.esp32c3.cortex-debug.custom.overrideRestartCommands.3=thb setup
|
||||||
|
|
||||||
|
# ESP32-C6 debug configuration (TBD)
|
||||||
|
debug_script.esp32c6=esp32c6-builtin.cfg
|
||||||
|
debug_config.esp32c6=
|
||||||
|
|
||||||
|
# ESP32-H2 debug configuration (TBD)
|
||||||
|
debug_script.esp32h2=esp32h2-builtin.cfg
|
||||||
|
debug_config.esp32h2=
|
||||||
|
|
||||||
|
# Debug API variable definitions
|
||||||
debug.executable={build.path}/{build.project_name}.elf
|
debug.executable={build.path}/{build.project_name}.elf
|
||||||
debug.toolchain=gcc
|
debug.toolchain=gcc
|
||||||
debug.toolchain.path={tools.{build.tarch}-esp-elf-gdb.path}/bin/
|
debug.toolchain.path={tools.{build.tarch}-esp-elf-gdb.path}/bin/
|
||||||
debug.toolchain.prefix={build.tarch}-{build.target}-elf-
|
debug.toolchain.prefix={build.tarch}-{build.target}-elf
|
||||||
debug.server=openocd
|
debug.server=openocd
|
||||||
debug.server.openocd.script=debug.cfg
|
debug.server.openocd.path={runtime.platform.path}/tools/openocd-esp32/bin/openocd
|
||||||
|
debug.server.openocd.scripts_dir={runtime.platform.path}/tools/openocd-esp32/share/openocd/scripts/
|
||||||
|
debug.server.openocd.scripts_dir.windows={runtime.platform.path}\tools\openocd-esp32\share\openocd\scripts\
|
||||||
|
debug.server.openocd.scripts.0=board/{debug_script.{build.mcu}}
|
||||||
|
debug.svd_file={runtime.platform.path}/tools/ide-debug/svd/{build.mcu}.svd
|
||||||
|
|
||||||
|
debug.cortex-debug.custom.objdumpPath={compiler.path}{compiler.prefix}objdump
|
||||||
|
debug.cortex-debug.custom.request=attach
|
||||||
|
debug.additional_config=debug_config.{build.mcu}
|
||||||
|
|
||||||
##
|
##
|
||||||
## ESPTool
|
## ESPTool
|
||||||
|
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
{
|
|
||||||
"name":"Arduino on ESP32",
|
|
||||||
"toolchainPrefix":"xtensa-esp32-elf",
|
|
||||||
"svdFile":"debug.svd",
|
|
||||||
"request":"attach",
|
|
||||||
"postAttachCommands":[
|
|
||||||
"set remote hardware-watchpoint-limit 2",
|
|
||||||
"monitor reset halt",
|
|
||||||
"monitor gdb_sync",
|
|
||||||
"thb setup",
|
|
||||||
"c"
|
|
||||||
],
|
|
||||||
"overrideRestartCommands":[
|
|
||||||
"monitor reset halt",
|
|
||||||
"monitor gdb_sync",
|
|
||||||
"thb setup",
|
|
||||||
"c"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
{
|
|
||||||
"name":"Arduino on ESP32-C3",
|
|
||||||
"toolchainPrefix":"riscv32-esp-elf",
|
|
||||||
"svdFile":"debug.svd",
|
|
||||||
"request":"attach",
|
|
||||||
"serverArgs":[
|
|
||||||
"-d3"
|
|
||||||
],
|
|
||||||
"overrideAttachCommands":[
|
|
||||||
"set remote hardware-watchpoint-limit 8",
|
|
||||||
"monitor reset",
|
|
||||||
"monitor halt",
|
|
||||||
"monitor gdb_sync",
|
|
||||||
"thb setup"
|
|
||||||
],
|
|
||||||
"overrideRestartCommands":[
|
|
||||||
"monitor reset",
|
|
||||||
"monitor halt",
|
|
||||||
"monitor gdb_sync",
|
|
||||||
"thb setup"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
{
|
|
||||||
"name":"Arduino on ESP32-S2",
|
|
||||||
"toolchainPrefix":"xtensa-esp32s2-elf",
|
|
||||||
"svdFile":"debug.svd",
|
|
||||||
"request":"attach",
|
|
||||||
"postAttachCommands":[
|
|
||||||
"set remote hardware-watchpoint-limit 2",
|
|
||||||
"monitor reset halt",
|
|
||||||
"monitor gdb_sync",
|
|
||||||
"thb setup",
|
|
||||||
"c"
|
|
||||||
],
|
|
||||||
"overrideRestartCommands":[
|
|
||||||
"monitor reset halt",
|
|
||||||
"monitor gdb_sync",
|
|
||||||
"thb setup",
|
|
||||||
"c"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
{
|
|
||||||
"name":"Arduino on ESP32-S3",
|
|
||||||
"toolchainPrefix":"xtensa-esp32s3-elf",
|
|
||||||
"svdFile":"debug.svd",
|
|
||||||
"request":"attach",
|
|
||||||
"overrideAttachCommands":[
|
|
||||||
"set remote hardware-watchpoint-limit 2",
|
|
||||||
"monitor reset halt",
|
|
||||||
"monitor gdb_sync",
|
|
||||||
"thb setup",
|
|
||||||
"interrupt"
|
|
||||||
],
|
|
||||||
"overrideRestartCommands":[
|
|
||||||
"monitor reset halt",
|
|
||||||
"monitor gdb_sync",
|
|
||||||
"interrupt"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
{
|
|
||||||
"name":"Arduino on ESP32-S3",
|
|
||||||
"toolchainPrefix":"xtensa-esp32s3-elf",
|
|
||||||
"svdFile":"debug.svd",
|
|
||||||
"request":"attach",
|
|
||||||
"overrideAttachCommands":[
|
|
||||||
"set remote hardware-watchpoint-limit 2",
|
|
||||||
"monitor reset halt",
|
|
||||||
"monitor gdb_sync",
|
|
||||||
"thb setup",
|
|
||||||
"c"
|
|
||||||
],
|
|
||||||
"overrideRestartCommands":[
|
|
||||||
"monitor reset halt",
|
|
||||||
"monitor gdb_sync"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
Loading…
Reference in a new issue