-
Notifications
You must be signed in to change notification settings - Fork 10
/
openocd.cfg
59 lines (42 loc) · 1.25 KB
/
openocd.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Ref: bl_iot_sdk/tools/debug/if_bflb_link.cfg
# source [find interface/if_bflb_link.cfg]
# BouffaloLab USB-JTAG/TTL adapter
adapter driver ftdi
ftdi_vid_pid 0x0403 0x6010
ftdi_channel 1
transport select jtag
adapter speed 2000
ftdi_layout_init 0x00f8 0x00fb
#ftdi_layout_signal nTRST -data 0x0400
#ftdi_layout_signal nSRST -ndata 0x0020
#reset_config srst_only srst_push_pull
#adapter_nsrst_delay 100
#adapter_nsrst_assert_width 100
# source [find target/tgt_602.cfg]
set _CHIPNAME riscv
jtag newtap $_CHIPNAME cpu -irlen 5 -expected-id 0x20000c05
set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME.0 riscv -chain-position $_TARGETNAME
$_TARGETNAME.0 configure -work-area-phys 0x22020000 -work-area-size 0x10000 -work-area-backup 1
echo "Ready for Remote Connections"
$_TARGETNAME.0 configure -event reset-assert-pre {
echo "reset-assert-pre"
adapter speed 100
}
$_TARGETNAME.0 configure -event reset-deassert-post {
echo "reset-deassert-post"
adapter speed 4000
reg mstatus 0x80000000
reg pc 0x21000000
}
$_TARGETNAME.0 configure -event reset-init {
echo "reset-init"
# 4MHz for FPGA
adapter speed 4000
}
gdb_memory_map enable
gdb_flash_program disable
riscv set_prefer_sba on
riscv set_command_timeout_sec 1
init
reset init