-
Notifications
You must be signed in to change notification settings - Fork 7
/
openocd.cfg
34 lines (28 loc) · 1.4 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
# HiFive Unmatched OpenOCD调试脚本
# 注意:在Windows下使用OpenOCD调试之前,请更换驱动到WinUSB驱动(可以使用Zadig软件完成操作)
# 需要将“Dual RS232-HS (Interface 0)”更换驱动,不需要更换Interface 1的驱动
#
# 脚本参考:https://gist.github.com/a4lg/df51da397b72299042182ccc19f75371
# 调试适配器设置
# HiFive Unmatched板载FTDI调试器
adapter speed 10000
adapter driver ftdi
ftdi_device_desc "Dual RS232-HS"
ftdi_vid_pid 0x0403 0x6010
ftdi_layout_init 0x0008 0x001b
ftdi_layout_signal nSRST -oe 0x0020 -data 0x0020
# 调试接入点和传输设置
# 使用JTAG传输协议
transport select jtag
# Freedom U740只有一个调试接入点(TAP),这个接入点指令寄存器的位宽最多为5
jtag newtap freedom-u740 cpu -irlen 5
# 接入所有的核心,包括一个S7(hart 0)和四个U74(hart 1-4)
target create freedom-u740.cpu0 riscv -chain-position freedom-u740.cpu -coreid 0 -rtos hwthread
target create freedom-u740.cpu1 riscv -chain-position freedom-u740.cpu -coreid 1
target create freedom-u740.cpu2 riscv -chain-position freedom-u740.cpu -coreid 2
target create freedom-u740.cpu3 riscv -chain-position freedom-u740.cpu -coreid 3
target create freedom-u740.cpu4 riscv -chain-position freedom-u740.cpu -coreid 4
target smp freedom-u740.cpu0 freedom-u740.cpu1 freedom-u740.cpu2 freedom-u740.cpu3 freedom-u740.cpu4
# 开始调试
init
halt