mirror of
https://github.com/zoobab/rtl8710.git
synced 2024-11-21 20:14:15 +00:00
57 lines
1.1 KiB
Text
57 lines
1.1 KiB
Text
#
|
|
# script for RTL8710
|
|
#
|
|
|
|
source [find target/swj-dp.tcl]
|
|
|
|
if { [info exists CHIPNAME] } {
|
|
set _CHIPNAME $CHIPNAME
|
|
} else {
|
|
set _CHIPNAME rtl8710
|
|
}
|
|
|
|
if { [info exists ENDIAN] } {
|
|
set _ENDIAN $ENDIAN
|
|
} else {
|
|
set _ENDIAN little
|
|
}
|
|
|
|
# Work-area is a space in RAM used for flash programming
|
|
# By default use 2kB
|
|
if { [info exists WORKAREASIZE] } {
|
|
set _WORKAREASIZE $WORKAREASIZE
|
|
} else {
|
|
set _WORKAREASIZE 0x800
|
|
}
|
|
|
|
if { [info exists CPUTAPID] } {
|
|
set _CPUTAPID $CPUTAPID
|
|
} else {
|
|
set _CPUTAPID 0x2ba01477
|
|
}
|
|
|
|
swj_newdap $_CHIPNAME cpu -irlen 4 -expected-id $_CPUTAPID
|
|
|
|
set _TARGETNAME $_CHIPNAME.cpu
|
|
target create $_TARGETNAME cortex_m -endian $_ENDIAN -chain-position $_TARGETNAME
|
|
|
|
$_TARGETNAME configure -work-area-phys 0x10000C00 -work-area-size $_WORKAREASIZE -work-area-backup 0
|
|
|
|
adapter_khz 500
|
|
adapter_nsrst_delay 100
|
|
|
|
if {![using_hla]} {
|
|
# if srst is not fitted use SYSRESETREQ to
|
|
# perform a soft reset
|
|
cortex_m reset_config sysresetreq
|
|
}
|
|
|
|
proc cortex_start {address} {
|
|
reg faultmask 0x01
|
|
set vectors ""
|
|
mem2array vectors 32 $address 2
|
|
reg sp $vectors(0)
|
|
reg pc $vectors(1)
|
|
resume
|
|
}
|
|
|