diff --git a/boards/others/canbardo/board.cmake b/boards/others/canbardo/board.cmake index 470cf0a5322..78a4abb3312 100644 --- a/boards/others/canbardo/board.cmake +++ b/boards/others/canbardo/board.cmake @@ -2,5 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 board_runner_args(jlink "--device=ATSAME70N20B") +board_runner_args(openocd --cmd-post-verify "atsamv gpnvm set 1") include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) +include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) diff --git a/boards/others/canbardo/canbardo_defconfig b/boards/others/canbardo/canbardo_defconfig index 72c0c1bffff..4f05a2b8cb7 100644 --- a/boards/others/canbardo/canbardo_defconfig +++ b/boards/others/canbardo/canbardo_defconfig @@ -1,6 +1,8 @@ # Copyright (c) 2024-2025 Henrik Brix Andersen # SPDX-License-Identifier: Apache-2.0 +CONFIG_BUILD_OUTPUT_HEX=y + CONFIG_ARM_MPU=y CONFIG_CACHE_MANAGEMENT=y CONFIG_HW_STACK_PROTECTION=y diff --git a/boards/others/canbardo/support/openocd.cfg b/boards/others/canbardo/support/openocd.cfg new file mode 100644 index 00000000000..590201b532e --- /dev/null +++ b/boards/others/canbardo/support/openocd.cfg @@ -0,0 +1,24 @@ +if {[info exists env(OPENOCD_INTERFACE)]} { + set INTERFACE $env(OPENOCD_INTERFACE) +} else { + set INTERFACE "cmsis-dap" +} + +source [find interface/$INTERFACE.cfg] + +transport select swd + +set CHIPNAME atsame70n20b + +source [find target/atsamv.cfg] + +$_TARGETNAME configure -event gdb-attach { + echo "Debugger attaching: halting execution" + reset halt + gdb_breakpoint_override hard +} + +$_TARGETNAME configure -event gdb-detach { + echo "Debugger detaching: resuming execution" + resume +}