-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
boards: raspberrypi: rpi_pico2: add OpenOCD runner configuration
Add OpenOCD debugger support. For now we will need a RaspberryPi forked version of OpenOCD. https://github.com/raspberrypi/openocd Signed-off-by: TOKITA Hiroshi <[email protected]> Signed-off-by: Andrew Featherstone <[email protected]>
- Loading branch information
Showing
3 changed files
with
26 additions
and
1 deletion.
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 |
---|---|---|
@@ -1,5 +1,18 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
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/rp2350.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(uf2 "--board-id=RP2350") | ||
|
||
include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake) | ||
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) | ||
include(${ZEPHYR_BASE}/boards/common/uf2.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
CONFIG_BUILD_OUTPUT_HEX=y | ||
CONFIG_BUILD_OUTPUT_UF2=y | ||
CONFIG_CLOCK_CONTROL=y | ||
CONFIG_CONSOLE=y | ||
|
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) 2024 TOKITA Hiroshi | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# Checking and set 'adapter speed'. | ||
# Set the adaptor speed, if unset, and given as an argument. | ||
proc set_adapter_speed_if_not_set { speed } { | ||
puts "checking adapter speed..." | ||
if { [catch {adapter speed} ret] } { | ||
adapter speed $speed | ||
} | ||
} |