target: restructure dap support
[fw/openocd] / tcl / target / at91samdXX.cfg
index 9a3c29282aa8fa5f29a380e5f5cfe9519549cc2b..f0644d1773a66e60ec72d1ee2a064134b8575220 100644 (file)
@@ -34,9 +34,10 @@ if { [info exists CPUTAPID] } {
 }
 
 swj_newdap $_CHIPNAME cpu -irlen 4 -expected-id $_CPUTAPID
+dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
 
 set _TARGETNAME $_CHIPNAME.cpu
-target create $_TARGETNAME cortex_m -endian $_ENDIAN -chain-position $_TARGETNAME
+target create $_TARGETNAME cortex_m -endian $_ENDIAN -dap $_CHIPNAME.dap
 
 $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
 
@@ -50,7 +51,8 @@ $_TARGETNAME configure -event reset-deassert-post {
 }
 
 # SRST (wired to RESET_N) resets debug circuitry
-reset_config srst_gates_jtag srst_pulls_trst
+# srst_pulls_trst is not configured here to avoid an error raised in reset halt
+reset_config srst_gates_jtag
 
 # Do not use a reset button with other SWD adapter than Atmel's EDBG.
 # DSU usually locks MCU in reset state until you issue a reset command