Skip to content

Commit

Permalink
Merge pull request #746 from facchinm/debugger_support
Browse files Browse the repository at this point in the history
debug: add support for latest arduino-cli
  • Loading branch information
facchinm authored Nov 13, 2023
2 parents 3142985 + 2ecf783 commit 52a91c4
Show file tree
Hide file tree
Showing 10 changed files with 374,533 additions and 5 deletions.
54 changes: 54 additions & 0 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ edge_control.bootloader.config=-f target/nrf52.cfg
edge_control.bootloader.programmer=-f interface/cmsis-dap.cfg
edge_control.bootloader.file=EDGE_CONTROL/bootloader.hex

edge_control.debug.server.openocd.scripts.0=interface/{programmer.protocol}.cfg
edge_control.debug.server.openocd.scripts.1={programmer.transport_script}
edge_control.debug.server.openocd.scripts.2=target/nrf52.cfg
edge_control.debug.svd_file={runtime.platform.path}/svd/nrf52840.svd

##############################################################

menu.split=Flash split
Expand Down Expand Up @@ -160,6 +165,12 @@ envie_m7.bootloader.programmer=-f interface/stlink.cfg
envie_m7.bootloader.extra_action.preflash=stm32h7x option_write 0 0x01c 0xb86aaf0
envie_m7.bootloader.file=PORTENTA_H7/portentah7_bootloader_mbed_hs_v2.elf

envie_m7.debug.server.openocd.scripts.0=interface/{programmer.protocol}.cfg
envie_m7.debug.server.openocd.scripts.1={programmer.transport_script}
envie_m7.debug.server.openocd.scripts.2=target/stm32h7x_dual_bank.cfg
envie_m7.menu.target_core.cm7.debug.svd_file={runtime.platform.path}/svd/STM32H747_CM7.svd
envie_m7.menu.target_core.cm4.debug.svd_file={runtime.platform.path}/svd/STM32H747_CM4.svd

envie_m7_thread_debug.name=Arduino Portenta H7 (ThreadDebug)
envie_m7_thread_debug.vid.0=0x2341
envie_m7_thread_debug.pid.0=0x025B
Expand Down Expand Up @@ -277,6 +288,11 @@ nano33ble.bootloader.config=-f target/nrf52.cfg
nano33ble.bootloader.programmer=-f interface/cmsis-dap.cfg
nano33ble.bootloader.file=nano33ble/bootloader.hex

nano33ble.debug.server.openocd.scripts.0=interface/{programmer.protocol}.cfg
nano33ble.debug.server.openocd.scripts.1={programmer.transport_script}
nano33ble.debug.server.openocd.scripts.2=target/nrf52.cfg
nano33ble.debug.svd_file={runtime.platform.path}/svd/nrf52840.svd

##############################################################

nanorp2040connect.name=Arduino Nano RP2040 Connect
Expand Down Expand Up @@ -333,6 +349,11 @@ nanorp2040connect.bootloader.tool.default=openocd
nanorp2040connect.bootloader.config=-f target/rp2040.cfg
nanorp2040connect.bootloader.programmer=-f interface/cmsis-dap.cfg

nanorp2040connect.debug.server.openocd.scripts.0=interface/{programmer.protocol}.cfg
nanorp2040connect.debug.server.openocd.scripts.1={programmer.transport_script}
nanorp2040connect.debug.server.openocd.scripts.2=target/rp2040-core0.cfg
nanorp2040connect.debug.svd_file={runtime.platform.path}/svd/rp2040.svd

##############################################################

pico.name=Raspberry Pi Pico
Expand Down Expand Up @@ -377,6 +398,11 @@ pico.bootloader.tool.default=openocd
pico.bootloader.config=-f target/rp2040.cfg
pico.bootloader.programmer=-f interface/cmsis-dap.cfg

pico.debug.server.openocd.scripts.0=interface/{programmer.protocol}.cfg
pico.debug.server.openocd.scripts.1={programmer.transport_script}
pico.debug.server.openocd.scripts.2=target/rp2040-core0.cfg
pico.debug.svd_file={runtime.platform.path}/svd/rp2040.svd

##############################################################

nicla_sense.name=Arduino Nicla Sense ME
Expand Down Expand Up @@ -424,6 +450,11 @@ nicla_sense.bootloader.config=-f target/nrf52.cfg
nicla_sense.bootloader.programmer=-f interface/cmsis-dap.cfg
nicla_sense.bootloader.file=NICLA/bootloader.hex

nicla_sense.debug.server.openocd.scripts.0=interface/{programmer.protocol}.cfg
nicla_sense.debug.server.openocd.scripts.1={programmer.transport_script}
nicla_sense.debug.server.openocd.scripts.2=target/nrf52.cfg
nicla_sense.debug.svd_file={runtime.platform.path}/svd/nrf52833.svd

##############################################################

nicla_voice.name=Arduino Nicla Voice
Expand Down Expand Up @@ -472,6 +503,11 @@ nicla_voice.bootloader.config=-f target/nrf52.cfg
nicla_voice.bootloader.programmer=-f interface/cmsis-dap.cfg
nicla_voice.bootloader.file=NICLA_VOICE/bootloader_application.hex

nicla_voice.debug.server.openocd.scripts.0=interface/{programmer.protocol}.cfg
nicla_voice.debug.server.openocd.scripts.1={programmer.transport_script}
nicla_voice.debug.server.openocd.scripts.2=target/nrf52.cfg
nicla_voice.debug.svd_file={runtime.platform.path}/svd/nrf52833.svd

##############################################################

nicla_vision.name=Arduino Nicla Vision
Expand Down Expand Up @@ -567,6 +603,12 @@ nicla_vision.bootloader.programmer=-f interface/stlink.cfg
nicla_vision.bootloader.extra_action.preflash=stm32h7x option_write 0 0x01c 0xb86aaf0
nicla_vision.bootloader.file=NICLA_VISION/bootloader.elf

nicla_vision.debug.server.openocd.scripts.0=interface/{programmer.protocol}.cfg
nicla_vision.debug.server.openocd.scripts.1={programmer.transport_script}
nicla_vision.debug.server.openocd.scripts.2=target/stm32h7x_dual_bank.cfg
nicla_vision.menu.target_core.cm7.debug.svd_file={runtime.platform.path}/svd/STM32H747_CM7.svd
nicla_vision.menu.target_core.cm4.debug.svd_file={runtime.platform.path}/svd/STM32H747_CM4.svd

##############################################################

opta.name=Opta
Expand Down Expand Up @@ -696,6 +738,12 @@ opta.bootloader.programmer=-f interface/stlink.cfg
opta.bootloader.extra_action.preflash=stm32h7x option_write 0 0x01c 0xb86aaf0
opta.bootloader.file=OPTA/bootloader.elf

opta.debug.server.openocd.scripts.0=interface/{programmer.protocol}.cfg
opta.debug.server.openocd.scripts.1={programmer.transport_script}
opta.debug.server.openocd.scripts.2=target/stm32h7x_dual_bank.cfg
opta.menu.target_core.cm7.debug.svd_file={runtime.platform.path}/svd/STM32H747_CM7.svd
opta.menu.target_core.cm4.debug.svd_file={runtime.platform.path}/svd/STM32H747_CM4.svd

##############################################################

giga.name=Arduino Giga R1
Expand Down Expand Up @@ -791,3 +839,9 @@ giga.bootloader.config=-f target/stm32h7x_dual_bank.cfg
giga.bootloader.programmer=-f interface/stlink.cfg
giga.bootloader.extra_action.preflash=stm32h7x option_write 0 0x01c 0xb86aaf0
giga.bootloader.file=GIGA/bootloader.elf

giga.debug.server.openocd.scripts.0=interface/{programmer.protocol}.cfg
giga.debug.server.openocd.scripts.1={programmer.transport_script}
giga.debug.server.openocd.scripts.2=target/stm32h7x_dual_bank.cfg
giga.menu.target_core.cm7.debug.svd_file={runtime.platform.path}/svd/STM32H747_CM7.svd
giga.menu.target_core.cm4.debug.svd_file={runtime.platform.path}/svd/STM32H747_CM4.svd
1 change: 1 addition & 0 deletions debugger/select_hla.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
transport select hla_swd
1 change: 1 addition & 0 deletions debugger/select_swd.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
transport select swd
21 changes: 17 additions & 4 deletions platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,25 @@ tools.adb.upload.params.quiet=
tools.adb.upload.pattern="{path}/{cmd}" push "{build.path}/{build.project_name}.elf" "/tmp/arduino/m4-user-sketch.elf"

#
# GDB (Debugger)
# Debugger
#
# EXPERIMENTAL feature: debug.pattern
# - this is alpha and may be subject to change without notice

tools.gdb.path={runtime.tools.arm-none-eabi-gcc-7-2017q4.path}/bin/
tools.gdb.cmd=arm-none-eabi-gdb
tools.gdb.cmd.windows=arm-none-eabi-gdb.exe
tools.gdb.debug.pattern="{path}/{cmd}" --interpreter=mi2 -ex "set pagination off" --baud 115200 -ex "set target-charset ASCII" -ex "target remote {debug.port}" {build.path}/{build.project_name}.elf

debug.executable={build.path}/{build.project_name}.elf
debug.toolchain=gcc
debug.toolchain.path={runtime.tools.arm-none-eabi-gcc-7-2017q4.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.cortex-debug.custom.postAttachCommands.0=set remote hardware-watchpoint-limit 2
debug.cortex-debug.custom.postAttachCommands.1=monitor reset halt
debug.cortex-debug.custom.postAttachCommands.2=monitor gdb_sync
debug.cortex-debug.custom.postAttachCommands.3=c
debug.cortex-debug.custom.overrideRestartCommands.0=monitor reset halt
debug.cortex-debug.custom.overrideRestartCommands.1=monitor gdb_sync
debug.cortex-debug.custom.overrideRestartCommands.2=c
25 changes: 24 additions & 1 deletion programmers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,34 @@ cmsis-dap.program.protocol=
cmsis-dap.program.tool=openocd
cmsis-dap.program.tool.default=openocd
cmsis-dap.program.extra_params=
cmsis-dap.programmer.protocol=cmsis-dap
cmsis-dap.programmer.transport_script={runtime.platform.path}/debugger/select_swd.cfg

stlink.name=STMicroelectronics STLINK
stlink.communication=USB
stlink.protocol=
stlink.program.protocol=
stlink.program.tool=openocd
stlink.program.tool.default=openocd
stlink.program.extra_params=
stlink.program.extra_params=
stlink.programmer.protocol=stlink
stlink.programmer.transport_script={runtime.platform.path}/debugger/select_hla.cfg

jlink.name=JLink
jlink.communication=USB
jlink.protocol=
jlink.program.protocol=
jlink.program.tool=openocd
jlink.program.tool.default=openocd
jlink.program.extra_params=
jlink.programmer.protocol=jlink
jlink.programmer.transport_script={runtime.platform.path}/debugger/select_swd.cfg

blackmagic.name=BlackMagic
blackmagic.communication=USB
blackmagic.protocol=
blackmagic.program.protocol=
blackmagic.program.tool=
blackmagic.program.tool.default=
blackmagic.program.extra_params=
blackmagic.debug.server=blackmagic
Loading

0 comments on commit 52a91c4

Please sign in to comment.