1# SPDX-License-Identifier: Apache-2.0
2
3if("${RPI_PICO_DEBUG_ADAPTER}" STREQUAL "")
4	set(RPI_PICO_DEBUG_ADAPTER "cmsis-dap")
5endif()
6
7board_runner_args(openocd --cmd-pre-init "source [find interface/${RPI_PICO_DEBUG_ADAPTER}.cfg]")
8board_runner_args(openocd --cmd-pre-init "source [find target/rp2350.cfg]")
9
10# The adapter speed is expected to be set by interface configuration.
11# The Raspberry Pi's OpenOCD fork doesn't, so match their documentation at
12# https://www.raspberrypi.com/documentation/microcontrollers/debug-probe.html#debugging-with-swd
13board_runner_args(openocd --cmd-pre-init "set_adapter_speed_if_not_set 5000")
14
15board_runner_args(uf2 "--board-id=RP2350")
16
17include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
18include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
19