OpenOCD config file for HiFive1 RevB

Hi All

I am trying to connect to HiFive1 - Rev B using FreedomStudio-2019-08-2-win64 (SiFive Eclipse IDE for C/C++ Development, Version: 4.12.0.2019-08-2) but I cannot find the correct openocd.cfg file to use. Can someone point me to one that works please.

# Using FreedomStudio-2019-08-2-win64\SiFive\freedom-e-sdk-v201908\bsp\sifive-hifive.cfg
# because I cannot find one for rev B
# Failed as the VID/PID are not correct
Open On-Chip Debugger 0.10.0+dev (SiFive OpenOCD 0.10.0-2019.08.2)
Licensed under GNU GPL v2
For bug reports:
    https://github.com/sifive/freedom-tools/issues
debug_level: 0
adapter speed: 10000 kHz
Error: no device found
Error: unable to open ftdi device with vid 0403, pid 6010, description 'Dual RS232-HS', serial '*' at bus location '*'


## Using github\sifive/riscv-openocd\tcl\board\sifive-hifive-revB.cfg
##  master branch commit 07df04b3b1eca3b920a9b4b411883d9d44fd06e5
Open On-Chip Debugger 0.10.0+dev (SiFive OpenOCD 0.10.0-2019.08.2)
Licensed under GNU GPL v2
For bug reports:
    https://github.com/sifive/freedom-tools/issues
debug_level: 0
 \path\to\openocd-code\tcl\board\sifive-hifive1-revb.cfg:1: Error: invalid subcommand "speed 4000"
in procedure 'script' 
at file "embedded:startup.tcl", line 63
 in procedure 'adapter' called at file "\path\to\openocd-code\tcl\board\sifive-hifive1-revb.cfg", line 1


##  Corrected adapter speed 4000 to "adapter_khz 4000"
Open On-Chip Debugger 0.10.0+dev (SiFive OpenOCD 0.10.0-2019.08.2)
Licensed under GNU GPL v2
For bug reports:
    https://github.com/sifive/freedom-tools/issues
debug_level: 0
Started by SiFive Freedom Studio
Error: Debug Adapter has to be specified, see "interface" command

Hi,
you can find it here
But I don’t think the openocd version that comes with FreedomStudio support the hifive1-revB. you can try to get openocd from github and use it separately :slightly_smiling_face:

Hi KMA,

Thank you for the reply. I got it working with github version. The OpenOCD supplied with FreedomStudio could not work as you had predicted. That’s most likely why it did not have the the config file.

For me, the confirmation comes when the OpenOCD version shipped with FreedomStudio complains about “adapter driver jlink” command but the github version did not. The config file use “adapter driver jlink” , the OpenOCD shipped with FreedomStudio does not understand it, wanting the “interface” command. From playing with github’s version of OpenOCD, I found out that the “adapter” command is intended to replace the “interface” command.

Many thanks
cinly

1 Like

Hi,

Is there a way to automate the download of the desired OpenOCD version through the platform settings?

[Disclaimer: I am not SiFive staff member]

No. First of all, OpenOCD does not do versioning. Secondly, to permit FreedomStudio to download any particular commit id comes with the implicit expectation that FreedomStudio tested that particular Commit ID. This has support implication for them.