Skip to content

Instantly share code, notes, and snippets.

@pansila
Last active April 17, 2024 02:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pansila/b7b1a906fa7cb365bc8a4d1cc93f80fd to your computer and use it in GitHub Desktop.
Save pansila/b7b1a906fa7cb365bc8a4d1cc93f80fd to your computer and use it in GitHub Desktop.
openocd script for debug aarch53
adapter driver jlink
set _CHIPNAME xxxxx
set _DAP_TAPID 0x6BA00477
adapter speed 10000
transport select jtag
bindto 0.0.0.0
reset_config trst_and_srst
telnet_port 4444
gdb_port 2331
# create tap
jtag newtap auto0 tap -irlen 4 -expected-id $_DAP_TAPID
# create dap
dap create auto0.dap -chain-position auto0.tap
#set DBGBASE {0x80410000 0x80510000 0x80610000 0x80710000}
#set CTIBASE {0x80420000 0x80520000 0x80620000 0x80720000}
#set DBGBASE {0x80810000 0x80910000 0x80a10000 0x80b10000}
#set CTIBASE {0x80820000 0x80920000 0x80a20000 0x80b20000}
# ensure to control only the target core for smp
set DBGBASE {0x80910000 0x80910000 0x80910000 0x80910000}
set CTIBASE {0x80920000 0x80920000 0x80920000 0x80920000}
set _cores 1
set _TARGETNAME $_CHIPNAME.a53
set _CTINAME $_CHIPNAME.cti
set _smp_command ""
for {set _core 0} {$_core < $_cores} { incr _core} {
cti create $_CTINAME.$_core -dap auto0.dap -ap-num 0 -baseaddr [lindex $CTIBASE $_core]
target create ${_TARGETNAME}.$_core aarch64 \
-dap auto0.dap -dbgbase [lindex $DBGBASE $_core] \
-coreid $_core -cti $_CTINAME.$_core
$_TARGETNAME.$_core configure -event gdb-attach { halt }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment