# NXP i.MX RT1050 family (Arm Cortex-M7 @ 600 MHz)
#

if { [info exists CHIPNAME] } {
	set _CHIPNAME $CHIPNAME
} else {
	set _CHIPNAME imxrt1050
}

source [find target/swj-dp.tcl]

if { [info exists CPU_SWD_TAPID] } {
	set _CPU_SWD_TAPID $CPU_SWD_TAPID
} else {
	set _CPU_SWD_TAPID 0x0bd11477
}

if { [using_jtag] } {
	set _CPU_TAPID 0
} else {
	set _CPU_TAPID $_CPU_SWD_TAPID
}

swj_newdap $_CHIPNAME cpu -irlen 4 -expected-id $_CPU_TAPID

set _TARGETNAME $_CHIPNAME
dap create $_TARGETNAME.dap -chain-position $_TARGETNAME.cpu
target create $_TARGETNAME cortex_m -dap $_TARGETNAME.dap

# $_TARGETNAME configure -rtos auto

cortex_m reset_config sysresetreq

gdb_breakpoint_override hard

adapter speed 8000
