forked from zephyrproject-rtos/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
boards: arm: sparkfun_pro_micro_rp2040: Support JTAG
Add SWD debugger support for this board. Although there is not a debug header, the SWD pins are accessible and the adaptor is not that difficult to wire up. This will allow for debugging beyond just flashing, that the UF2 programming setup allows for. Signed-off-by: David Brown <[email protected]>
- Loading branch information
Showing
3 changed files
with
58 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# This configuration allows selecting what debug adapter debugging to use | ||
# for the SparkFun Pro Micro RP2040 by a command-line argument. | ||
# It is mainly intended to support both the 'picoprobe' and 'raspberrypi-swd' | ||
# adapter described in "Getting started with Raspberry Pi Pico". | ||
# And any other SWD debug adapter might also be usable with this configuration. | ||
|
||
# Note that the Pro Micro RP2040 SWD pins are test points on the underside | ||
# of the board. | ||
|
||
# Set RPI_PICO_DEBUG_ADAPTER to select debug adapter by command-line arguments. | ||
# e.g.) west build -b rpi_pico -- -DRPI_PICO_DEBUG_ADAPTER=raspberrypi-swd | ||
# The value is treated as a part of an interface file name that | ||
# the debugger's configuration file. | ||
# The value must be the 'stem' part of the name of one of the files | ||
# in the openocd interface configuration file. | ||
# The setting is store to CMakeCache.txt. | ||
if ("${RPI_PICO_DEBUG_ADAPTER}" STREQUAL "") | ||
set(RPI_PICO_DEBUG_ADAPTER "cmsis-dap") | ||
endif() | ||
|
||
board_runner_args(openocd --cmd-pre-init "source [find interface/${RPI_PICO_DEBUG_ADAPTER}.cfg]") | ||
board_runner_args(openocd --cmd-pre-init "transport select swd") | ||
board_runner_args(openocd --cmd-pre-init "source [find target/rp2040.cfg]") | ||
|
||
# The adapter speed is expected to be set by interface configuration. | ||
# But if not so, set 2000 to adapter speed. | ||
board_runner_args(openocd --cmd-pre-init "set_adapter_speed_if_not_set 2000") | ||
|
||
board_runner_args(jlink "--device=RP2040_M0_0") | ||
board_runner_args(uf2 "--board-id=RPI-RP2") | ||
board_runner_args(pyocd "--target=rp2040") | ||
|
||
include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake) | ||
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) | ||
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) | ||
include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake) | ||
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright (c) 2022 Tokita, Hiroshi <[email protected]> | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# Checking and set 'adapter speed'. | ||
# Set adapter speed that assigned by argument if not be seted. | ||
proc set_adapter_speed_if_not_set { speed } { | ||
puts "checking adapter speed..." | ||
if { [catch {adapter speed} ret] } { | ||
adapter speed $speed | ||
} | ||
} |