add support for IDE v2 debug with openocd + cmsis-dap probe

jlink over openocd cfg is also added for reference. User with jlink want
to debug can either use debug_custom.json or change the
build.openocdscript to jlink_nrf52.cfg instead
This commit is contained in:
hathach committed 2023-06-23 12:58:20 +07:00
1 parent cd74d9e11e
commit a6dfad8cd2
6 files changed
+92 -46

No files matched your search

+27 -4
View File
@@ -128,11 +128,11 @@ recipe.size.regex.data=^(?:\.data|\.bss)\s+([0-9]+).*
recipe.output.tmp_file={build.project_name}.hex
recipe.output.save_file={build.project_name}.{build.variant}.hex
#***************************************************
# ------------------------------------------------
# adafruit-nrfutil for uploading
# https://github.com/adafruit/Adafruit_nRF52_nrfutil
# pre-built binaries are provided for macos and windows
#***************************************************
# ------------------------------------------------
tools.nrfutil.cmd=adafruit-nrfutil
tools.nrfutil.cmd.windows={runtime.platform.path}/tools/adafruit-nrfutil/win32/adafruit-nrfutil.exe
tools.nrfutil.cmd.macosx={runtime.platform.path}/tools/adafruit-nrfutil/macos/adafruit-nrfutil
@@ -141,9 +141,9 @@ tools.nrfutil.upload.params.verbose=--verbose
tools.nrfutil.upload.params.quiet=
tools.nrfutil.upload.pattern="{cmd}" {upload.verbose} dfu serial -pkg "{build.path}/{build.project_name}.zip" -p {serial.port} -b 115200 --singlebank
#***************************************************
# ---------------------------------------------------
# Burning bootloader with either jlink or nrfutil
#***************************************************
# ---------------------------------------------------
# Bootloader version
tools.bootburn.bootloader.file={runtime.platform.path}/bootloader/{build.variant}/{build.variant}_bootloader-0.6.2_{build.sd_name}_{build.sd_version}
@@ -157,3 +157,26 @@ tools.bootburn.erase.params.verbose=
tools.bootburn.erase.params.quiet=
tools.bootburn.erase.pattern=
# ----------------------------------------
# Debugger configuration (general options)
# ----------------------------------------
# EXPERIMENTAL feature:
# - this is alpha and may be subject to change without notice
debug.executable={build.path}/{build.project_name}.elf
debug.toolchain=gcc
debug.toolchain.path={runtime.tools.arm-none-eabi-gcc.path}/bin/
debug.toolchain.prefix=arm-none-eabi-
debug.server=openocd
debug.server.openocd.path={runtime.tools.openocd-0.11.0-arduino2.path}/bin/openocd
debug.server.openocd.scripts_dir={runtime.tools.openocd-0.11.0-arduino2.path}/share/openocd/scripts/
debug.server.openocd.script={runtime.platform.path}/{build.openocdscript}
# JLinkServer is not supported by arduino-cli yet
# https://github.com/arduino/arduino-cli/blob/eca9d9a8f00582a08fadea8a4b7e3ef01b40d082/commands/debug/debug.go#L160
# use debug_custom.json to run JLinkGDBServer instead
# https://docs.arduino.cc/tutorials/mkr-wifi-1010/mkr-jlink-setup
#debug.server=jlink
#debug.server.jlink.path=JLinkGDBServer
#debug.server.jlink.device=nrf52840_xxaa
#debug.server.jlink.script={runtime.platform.path}/{build.openocdscript}