1# SPDX-License-Identifier: Apache-2.0
2if(CONFIG_BUILD_WITH_TFM)
3  set(TFM_FLASH_BASE_ADDRESS 0x0C000000)
4
5  # Flash merged TF-M + Zephyr binary
6  set_property(TARGET runners_yaml_props_target PROPERTY hex_file tfm_merged.hex)
7
8  if (CONFIG_HAS_FLASH_LOAD_OFFSET)
9    MATH(EXPR TFM_HEX_BASE_ADDRESS_NS "${TFM_FLASH_BASE_ADDRESS}+${CONFIG_FLASH_LOAD_OFFSET}")
10  else()
11    set(TFM_HEX_BASE_ADDRESS_NS ${TFM_TFM_FLASH_BASE_ADDRESS})
12  endif()
13endif()
14
15board_runner_args(stm32cubeprogrammer "--erase" "--port=swd" "--reset-mode=hw")
16board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw")
17
18board_runner_args(openocd "--tcl-port=6666")
19board_runner_args(openocd --cmd-pre-init "gdb_report_data_abort enable")
20board_runner_args(openocd "--no-halt")
21
22include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake)
23# FIXME: openocd runner requires use of STMicro openocd fork.
24# Check board documentation for more details.
25include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
26