1# SPDX-License-Identifier: Apache-2.0
2
3include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake)
4
5if(CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP OR CONFIG_BOARD_NRF54H20DK_NRF54H20_CPURAD)
6  if(CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP)
7    set(JLINKSCRIPTFILE ${CMAKE_CURRENT_LIST_DIR}/support/nrf54h20_cpuapp.JLinkScript)
8  else()
9    set(JLINKSCRIPTFILE ${CMAKE_CURRENT_LIST_DIR}/support/nrf54h20_cpurad.JLinkScript)
10  endif()
11
12  board_runner_args(jlink "--device=CORTEX-M33" "--speed=4000" "--tool-opt=-jlinkscriptfile ${JLINKSCRIPTFILE}")
13  include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
14endif()
15
16if(CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUPPR OR CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUFLPR)
17  if(CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUPPR)
18    set(JLINKSCRIPTFILE ${CMAKE_CURRENT_LIST_DIR}/support/nrf54h20_cpuppr.JLinkScript)
19  else()
20    set(JLINKSCRIPTFILE ${CMAKE_CURRENT_LIST_DIR}/support/nrf54h20_cpuflpr.JLinkScript)
21  endif()
22
23  board_runner_args(jlink "--device=RISC-V" "--speed=4000" "-if SW" "--tool-opt=-jlinkscriptfile ${JLINKSCRIPTFILE}")
24  include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
25endif()
26