1if {[info exists env(OPENOCD_INTERFACE)]} {
2	set INTERFACE $env(OPENOCD_INTERFACE)
3} else {
4	# By default connect over Debug USB port using the EDBG chip
5	set INTERFACE "cmsis-dap"
6}
7
8source [find interface/$INTERFACE.cfg]
9
10transport select swd
11
12set CHIPNAME atsam4e16e
13
14source [find target/at91sam4sXX.cfg]
15
16reset_config srst_only
17
18$_TARGETNAME configure -event gdb-attach {
19	echo "Debugger attaching: halting execution"
20	reset halt
21	gdb_breakpoint_override hard
22}
23
24$_TARGETNAME configure -event gdb-detach {
25	echo "Debugger detaching: resuming execution"
26	resume
27}
28