Skip to content

Commit 1f9cca4

Browse files
henrikbrixandersendanieldegrasse
authored andcommitted
boards: others: canbardo: add openocd configuration
Add OpenOCD support to the CANbardo board definition. Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
1 parent 9f0ca75 commit 1f9cca4

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

boards/others/canbardo/board.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
board_runner_args(jlink "--device=ATSAME70N20B")
5+
board_runner_args(openocd --cmd-post-verify "atsamv gpnvm set 1")
56

67
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
8+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

boards/others/canbardo/canbardo_defconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Copyright (c) 2024-2025 Henrik Brix Andersen <henrik@brixandersen.dk>
22
# SPDX-License-Identifier: Apache-2.0
33

4+
CONFIG_BUILD_OUTPUT_HEX=y
5+
46
CONFIG_ARM_MPU=y
57
CONFIG_CACHE_MANAGEMENT=y
68
CONFIG_HW_STACK_PROTECTION=y
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
if {[info exists env(OPENOCD_INTERFACE)]} {
2+
set INTERFACE $env(OPENOCD_INTERFACE)
3+
} else {
4+
set INTERFACE "cmsis-dap"
5+
}
6+
7+
source [find interface/$INTERFACE.cfg]
8+
9+
transport select swd
10+
11+
set CHIPNAME atsame70n20b
12+
13+
source [find target/atsamv.cfg]
14+
15+
$_TARGETNAME configure -event gdb-attach {
16+
echo "Debugger attaching: halting execution"
17+
reset halt
18+
gdb_breakpoint_override hard
19+
}
20+
21+
$_TARGETNAME configure -event gdb-detach {
22+
echo "Debugger detaching: resuming execution"
23+
resume
24+
}

0 commit comments

Comments
 (0)