Skip to content

Commit

Permalink
boards: nordic: nrf54h20pdk: add debugging support using J-Link
Browse files Browse the repository at this point in the history
cpuapp/cpurad can be debugged using the J-Link runner.

Note:
This feature is still experimental and has known issues. For example,
setting a breakpoint to main requires to patch init.c with a loop
polling a variable so that we stop there until unset from GDB.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
  • Loading branch information
gmarull authored and carlescufi committed Mar 11, 2024
1 parent cba1e34 commit 69586d1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions boards/nordic/nrf54h20pdk/board.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# SPDX-License-Identifier: Apache-2.0

include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)

if(CONFIG_BOARD_NRF54H20PDK_NRF54H20_CPUAPP OR CONFIG_BOARD_NRF54H20PDK_NRF54H20_CPURAD)
if(CONFIG_BOARD_NRF54H20PDK_NRF54H20_CPURAD)
set(
JLINK_TOOL_OPT
"-jlinkscriptfile ${CMAKE_CURRENT_LIST_DIR}/support/nrf54h20_cpurad.JLinkScript"
)
endif()

board_runner_args(jlink "--device=CORTEX-M33" "--speed=4000" "--tool-opt=${JLINK_TOOL_OPT}")
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
endif()
4 changes: 4 additions & 0 deletions boards/nordic/nrf54h20pdk/support/nrf54h20_cpurad.JLinkScript
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
void ConfigTargetSettings(void) {
JLINK_ExecCommand("CORESIGHT_AddAP = Index=1 Type=AHB-AP");
CORESIGHT_IndexAHBAPToUse = 1;
}

0 comments on commit 69586d1

Please sign in to comment.