1# SPDX-License-Identifier: Apache-2.0
2
3board_runner_args(dfu-util "--pid=2341:0364" "--alt=0" "--dfuse")
4
5if(CONFIG_BOARD_ARDUINO_OPTA_STM32H747XX_M7)
6  board_runner_args(openocd "--config=${BOARD_DIR}/support/openocd_opta_stm32h747xx_m7.cfg")
7  board_runner_args(openocd --target-handle=_CHIPNAME.cpu0)
8elseif(CONFIG_BOARD_ARDUINO_OPTA_STM32H747XX_M4)
9  board_runner_args(openocd "--config=${BOARD_DIR}/support/openocd_opta_stm32h747xx_m4.cfg")
10  board_runner_args(openocd --target-handle=_CHIPNAME.cpu1)
11endif()
12
13board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw")
14
15# Give priority to dfu-util to flash, ST-Link to debug.
16include(${ZEPHYR_BASE}/boards/common/dfu-util.board.cmake)
17include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake)
18include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)