}
swj_newdap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
+dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
set _TARGETNAME $_CHIPNAME.cpu
-target create $_TARGETNAME cortex_m -chain-position $_TARGETNAME
+target create $_TARGETNAME cortex_m -dap $_CHIPNAME.dap
$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
set _FLASHNAME $_CHIPNAME.flash
flash bank $_FLASHNAME psoc4 0 0 0 0 $_TARGETNAME
-adapter_khz 1500
+adapter speed 1500
# Reset, bloody PSoC 4 reset
#
if { $err } {
return 0
}
- if { [expr $romtable_pid(0) & 0xffffff00 ]
- || [expr $romtable_pid(1) & 0xffffff00 ]
- || [expr $romtable_pid(2) & 0xffffff00 ] } {
+ if { [expr {$romtable_pid(0) & 0xffffff00 }]
+ || [expr {$romtable_pid(1) & 0xffffff00 }]
+ || [expr {$romtable_pid(2) & 0xffffff00 }] } {
echo "Unexpected data in ROMTABLE"
return 0
}
- set designer_id [expr (( $romtable_pid(1) & 0xf0 ) >> 4) | (( $romtable_pid(2) & 0xf ) << 4 ) ]
+ set designer_id [expr {(( $romtable_pid(1) & 0xf0 ) >> 4) | (( $romtable_pid(2) & 0xf ) << 4 ) }]
if { $designer_id != 0xb4 } {
echo [format "ROMTABLE Designer ID 0x%02x is not Cypress" $designer_id]
return 0
}
- set family_id [expr ( $romtable_pid(0) & 0xff ) | (( $romtable_pid(1) & 0xf ) << 8 ) ]
+ set family_id [expr {( $romtable_pid(0) & 0xff ) | (( $romtable_pid(1) & 0xf ) << 8 ) }]
return $family_id
}
}
if { ! [info exists PSOC4_USE_ACQUIRE] } {
- if { 0 == [string compare [adapter_name] kitprog ] } {
+ if { 0 == [string compare [adapter name] kitprog ] } {
set PSOC4_USE_ACQUIRE 1
} else {
set PSOC4_USE_ACQUIRE 0
$t invoke-event reset-assert-pre
if { $halt && $PSOC4_USE_ACQUIRE } {
- catch { [adapter_name] acquire_psoc }
+ catch { [adapter name] acquire_psoc }
$t arp_examine
} else {
if { $PSOC4_TEST_MODE_WORKAROUND } {
}
# Check if PSoC CPU is stopped in system ROM
- set pc [ocd_reg pc]
+ set pc [reg pc]
regsub {pc[^:]*: } $pc "" pc
if { $pc < 0x10000000 || $pc > 0x1000ffff } {
set hint ""
# Set registers to reset vector values
mem2array value 32 0 2
- reg pc [expr $value(1) & 0xfffffffe ]
+ reg pc [expr {$value(1) & 0xfffffffe} ]
reg msp $value(0)
if { $PSOC4_TEST_MODE_WORKAROUND } {