• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1adapter_khz     1000
2
3interface ftdi
4ftdi_vid_pid 0x0403 0x6010
5ftdi_oscan1_mode off
6
7## bindto 0.0.0.0 can be used to cover all available interfaces.
8## Uncomment bindto line to enable remote machine debug
9# bindto 0.0.0.0
10
11## If ftdi_device_desc not specified, the device description is ignored during device selection.
12## So if you want to specify a dedicated FTDI device, you can select following device description:
13## "Dual RS232-HS" is for Nuclei HummingBird Debugger V1
14## "USB <-> JTAG-DEBUGGER" is for Nuclei HummingBird Debugger V2
15## Uncomment one which match your device description
16# ftdi_device_desc "Dual RS232-HS"
17# ftdi_device_desc "USB <-> JTAG-DEBUGGER"
18
19transport select jtag
20
21ftdi_layout_init 0x0008 0x001b
22ftdi_layout_signal nSRST -oe 0x0020 -data 0x0020
23ftdi_layout_signal TCK -data 0x0001
24ftdi_layout_signal TDI -data 0x0002
25ftdi_layout_signal TDO -input 0x0004
26ftdi_layout_signal TMS -data 0x0008
27ftdi_layout_signal JTAG_SEL -data 0x0100 -oe 0x0100
28
29set _CHIPNAME riscv
30jtag newtap $_CHIPNAME cpu -irlen 5
31
32set _TARGETNAME $_CHIPNAME.cpu
33target create $_TARGETNAME riscv -chain-position $_TARGETNAME
34$_TARGETNAME configure -work-area-phys 0x80000000 -work-area-size 10000 -work-area-backup 1
35
36set _FLASHNAME $_CHIPNAME.flash
37flash bank $_FLASHNAME fespi 0x20000000 0 0 0 $_TARGETNAME
38# Set the ILM space also as flash, to make sure it can be add breakpoint with hardware trigger
39#flash bank onboard_ilm fespi 0x80000000 0 0 0 $_TARGETNAME
40
41# Expose Nuclei self-defined CSRS
42# See https://github.com/riscv/riscv-gnu-toolchain/issues/319#issuecomment-358397306
43# Then user can view the csr register value in gdb using: info reg csr775 for CSR MTVT(0x307)
44riscv expose_csrs 416-496,770-800,835-850,1227-1231,1483-1486,1984-2032,2064-2070,2370-2380,2490-2500,4032-4040
45
46init
47
48if {[ info exists pulse_srst]} {
49  ftdi_set_signal nSRST 0
50  ftdi_set_signal nSRST z
51}
52halt
53# We must turn on this because otherwise the IDE version debug cannot download the program into flash
54flash protect 0 0 last off
55