Skip to content

Commit 164decd

Browse files
authored
Merge pull request #346 from adafruit/ide2-debug
Arduino IDE v2 debuging suport
2 parents 313ef47 + bc76c89 commit 164decd

File tree

12 files changed

+829
-381
lines changed

12 files changed

+829
-381
lines changed

.github/workflows/githubci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ jobs:
6262
arduino-cli lib install "Adafruit NeoPixel" "Adafruit seesaw Library" "Adafruit SPIFlash" "FlashStorage" "MIDI Library" "SD" "SdFat - Adafruit Fork"
6363
6464
- name: Build examples
65-
run: python3 extras/build_all.py ${{ matrix.board }}
65+
run: python3 tools/build_all.py ${{ matrix.board }}

boards.txt

Lines changed: 287 additions & 69 deletions
Large diffs are not rendered by default.

extras/makeboards.py

Lines changed: 0 additions & 303 deletions
This file was deleted.

platform.txt

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,52 +173,76 @@ tools.bossacI.upload.network_pattern="{network_cmd}" -address {serial.port} -por
173173
# OpenOCD sketch upload
174174
#
175175

176-
tools.openocd.path={runtime.tools.openocd-0.10.0-arduino7.path}
176+
tools.openocd.path={runtime.tools.openocd-0.11.0-arduino2.path}
177177
tools.openocd.cmd=bin/openocd
178178
tools.openocd.cmd.windows=bin/openocd.exe
179179

180180
tools.openocd.upload.params.verbose=-d2
181181
tools.openocd.upload.params.quiet=-d0
182-
tools.openocd.upload.pattern="{path}/{cmd}" {upload.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.bin} verify reset 0x2000; shutdown"
182+
tools.openocd.upload.pattern="{path}/{cmd}" {upload.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.bin} verify reset 0x2000; shutdown"
183183

184184
tools.openocd.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA
185185
tools.openocd.upload.network_pattern={network_cmd} -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b
186186

187187
# Program flashes the binary at 0x0000, so use the linker script without_bootloader
188188
tools.openocd.program.params.verbose=-d2
189189
tools.openocd.program.params.quiet=-d0
190-
tools.openocd.program.pattern="{path}/{cmd}" {program.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.elf} verify reset; shutdown"
190+
tools.openocd.program.pattern="{path}/{cmd}" {program.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.elf} verify reset; shutdown"
191191

192192
tools.openocd.erase.params.verbose=-d3
193193
tools.openocd.erase.params.quiet=-d0
194194
tools.openocd.erase.pattern=
195195

196196
tools.openocd.bootloader.params.verbose=-d2
197197
tools.openocd.bootloader.params.quiet=-d0
198-
tools.openocd.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; init; halt; at91samd bootloader 0; program {{runtime.platform.path}/bootloaders/{bootloader.file}} verify reset; shutdown"
198+
tools.openocd.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/{build.openocdscript}" -c "telnet_port disabled; init; halt; at91samd bootloader 0; program {{runtime.platform.path}/bootloaders/{bootloader.file}} verify reset; shutdown"
199199

200200
#
201201
# OpenOCD sketch upload - version with configurable bootloader size
202202
# FIXME: this programmer is a workaround for default options being overwritten by uploadUsingPreferences
203203
#
204204

205-
tools.openocd-withbootsize.path={runtime.tools.openocd-0.10.0-arduino7.path}
205+
tools.openocd-withbootsize.path={runtime.tools.openocd-0.11.0-arduino2.path}
206206
tools.openocd-withbootsize.cmd=bin/openocd
207207
tools.openocd-withbootsize.cmd.windows=bin/openocd.exe
208208

209209
tools.openocd-withbootsize.upload.params.verbose=-d2
210210
tools.openocd-withbootsize.upload.params.quiet=-d0
211-
tools.openocd-withbootsize.upload.pattern="{path}/{cmd}" {upload.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.bin} verify reset {bootloader.size}; shutdown"
211+
tools.openocd-withbootsize.upload.pattern="{path}/{cmd}" {upload.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.bin} verify reset {bootloader.size}; shutdown"
212212

213213
# Program flashes the binary at 0x0000, so use the linker script without_bootloader
214214
tools.openocd-withbootsize.program.params.verbose=-d2
215215
tools.openocd-withbootsize.program.params.quiet=-d0
216-
tools.openocd-withbootsize.program.pattern="{path}/{cmd}" {program.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.elf} verify reset; shutdown"
216+
tools.openocd-withbootsize.program.pattern="{path}/{cmd}" {program.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/{build.openocdscript}" -c "telnet_port disabled; program {{build.path}/{build.project_name}.elf} verify reset; shutdown"
217217

218218
tools.openocd-withbootsize.erase.params.verbose=-d3
219219
tools.openocd-withbootsize.erase.params.quiet=-d0
220220
tools.openocd-withbootsize.erase.pattern=
221221

222222
tools.openocd-withbootsize.bootloader.params.verbose=-d2
223223
tools.openocd-withbootsize.bootloader.params.quiet=-d0
224-
tools.openocd-withbootsize.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; init; halt; at91samd bootloader 0; program {{runtime.platform.path}/bootloaders/{bootloader.file}} verify reset; shutdown"
224+
tools.openocd-withbootsize.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/{build.openocdscript}" -c "telnet_port disabled; init; halt; at91samd bootloader 0; program {{runtime.platform.path}/bootloaders/{bootloader.file}} verify reset; shutdown"
225+
226+
# ----------------------------------------
227+
# Debugger configuration (general options)
228+
# ----------------------------------------
229+
# EXPERIMENTAL feature:
230+
# - this is alpha and may be subject to change without notice
231+
debug.executable={build.path}/{build.project_name}.elf
232+
debug.toolchain=gcc
233+
debug.toolchain.path={runtime.tools.arm-none-eabi-gcc.path}/bin/
234+
debug.toolchain.prefix=arm-none-eabi-
235+
236+
debug.server=openocd
237+
debug.server.openocd.path={runtime.tools.openocd-0.11.0-arduino2.path}/bin/openocd
238+
debug.server.openocd.scripts_dir={runtime.tools.openocd-0.11.0-arduino2.path}/share/openocd/scripts/
239+
debug.server.openocd.script={runtime.platform.path}/{build.openocdscript}
240+
241+
# JLinkServer is not supported by arduino-cli yet
242+
# https://github.com/arduino/arduino-cli/blob/eca9d9a8f00582a08fadea8a4b7e3ef01b40d082/commands/debug/debug.go#L160
243+
# use debug_custom.json to run JLinkGDBServer instead
244+
# https://docs.arduino.cc/tutorials/mkr-wifi-1010/mkr-jlink-setup
245+
#debug.server=jlink
246+
#debug.server.jlink.path=JLinkGDBServer
247+
#debug.server.jlink.device=ATSAMD21G18
248+
#debug.server.jlink.script={runtime.platform.path}/{build.openocdscript}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"servertype": "jlink",
3+
"device": "ATSAMD21G18A",
4+
"interface": "SWD",
5+
"serverpath": "JLinkGDBServer"
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"servertype": "jlink",
3+
"device": "ATSAMD51G18",
4+
"interface": "SWD",
5+
"serverpath": "JLinkGDBServer"
6+
}

scripts/openocd/daplink_samd21.cfg

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#
2+
# Arduino Zero OpenOCD script.
3+
#
4+
# Copyright (c) 2014-2015 Arduino LLC. All right reserved.
5+
#
6+
# This library is free software; you can redistribute it and/or
7+
# modify it under the terms of the GNU Lesser General Public
8+
# License as published by the Free Software Foundation; either
9+
# version 2.1 of the License, or (at your option) any later version.
10+
#
11+
# This library is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14+
# See the GNU Lesser General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU Lesser General Public
17+
# License along with this library; if not, write to the Free Software
18+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19+
#
20+
21+
source [find interface/cmsis-dap.cfg]
22+
transport select swd
23+
24+
# chip name
25+
set CHIPNAME samd21
26+
27+
source [find target/at91samdXX.cfg]

scripts/openocd/daplink_samd51.cfg

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#
2+
# Arduino Zero OpenOCD script.
3+
#
4+
# Copyright (c) 2014-2015 Arduino LLC. All right reserved.
5+
#
6+
# This library is free software; you can redistribute it and/or
7+
# modify it under the terms of the GNU Lesser General Public
8+
# License as published by the Free Software Foundation; either
9+
# version 2.1 of the License, or (at your option) any later version.
10+
#
11+
# This library is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14+
# See the GNU Lesser General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU Lesser General Public
17+
# License along with this library; if not, write to the Free Software
18+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19+
#
20+
21+
source [find interface/cmsis-dap.cfg]
22+
transport select swd
23+
24+
# chip name
25+
set CHIPNAME samd51
26+
27+
source [find target/atsame5x.cfg]

scripts/openocd/jlink_samd21.cfg

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#
2+
# Arduino Zero OpenOCD script.
3+
#
4+
# Copyright (c) 2014-2015 Arduino LLC. All right reserved.
5+
#
6+
# This library is free software; you can redistribute it and/or
7+
# modify it under the terms of the GNU Lesser General Public
8+
# License as published by the Free Software Foundation; either
9+
# version 2.1 of the License, or (at your option) any later version.
10+
#
11+
# This library is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14+
# See the GNU Lesser General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU Lesser General Public
17+
# License along with this library; if not, write to the Free Software
18+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19+
#
20+
21+
source [find interface/jlink.cfg]
22+
transport select swd
23+
24+
# chip name
25+
set CHIPNAME samd21
26+
27+
source [find target/at91samdXX.cfg]

scripts/openocd/jlink_samd51.cfg

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#
2+
# Arduino Zero OpenOCD script.
3+
#
4+
# Copyright (c) 2014-2015 Arduino LLC. All right reserved.
5+
#
6+
# This library is free software; you can redistribute it and/or
7+
# modify it under the terms of the GNU Lesser General Public
8+
# License as published by the Free Software Foundation; either
9+
# version 2.1 of the License, or (at your option) any later version.
10+
#
11+
# This library is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14+
# See the GNU Lesser General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU Lesser General Public
17+
# License along with this library; if not, write to the Free Software
18+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19+
#
20+
21+
source [find interface/jlink.cfg]
22+
transport select swd
23+
24+
# chip name
25+
set CHIPNAME samd51
26+
27+
source [find target/atsame5x.cfg]

0 commit comments

Comments
 (0)