1# From https://github.com/sifive/freedom-e-sdk/blob/c07ac84cbdd678963c4dc3ea34a68c47a8b53651/bsp/sifive-hifive1/openocd.cfg2#3# Copyright (c) 2019 SiFive, Inc.4# Licensed under Apache2 and MIT licenses.56# JTAG adapter setup7adapter_khz 1000089set chain_length 51011interface ftdi12ftdi_device_desc "Dual RS232-HS"13ftdi_vid_pid 0x0403 0x60101415ftdi_layout_init 0x0008 0x001b16ftdi_layout_signal nSRST -oe 0x002017ftdi_layout_signal LED -data 0x00201819set _CHIPNAME riscv20jtag newtap $_CHIPNAME cpu -irlen $chain_length2122set _TARGETNAME_0 $_CHIPNAME.cpu2324target create $_TARGETNAME_0 riscv -chain-position $_TARGETNAME_02526$_TARGETNAME_0 configure -work-area-phys 0x80000000 -work-area-size 0x2710 -work-area-backup 12728if { $chain_length == 6 } {29 riscv use_bscan_tunnel 530}3132flash bank spi0 fespi 0x20000000 0 0 0 $_TARGETNAME_0 0x100140003334init35if { [info exists authkey] } {36 riscv authdata_write $authkey37}3839if {[ info exists pulse_srst]} {40 ftdi_set_signal nSRST 041 ftdi_set_signal nSRST z42 sleep 150043}44halt4546flash protect 0 64 last off4748echo "Ready for Remote Connections"