OpenCores
no use no use 1/1 no use no use
OpenOCD with adv_debug_sys over ORSoC USB-JTAG-Debugger
by schafrichter on Jan 21, 2014
schafrichter
Posts: 10
Joined: Jul 9, 2009
Last seen: Nov 13, 2014
Hi there,

this most probably adresses Franck Julien and/or Julius Baxter since they did the port from openOCD to the OpenRISC.

I want to use openOCD as a GDB server to connect to my OpenRISC system. On FPGA level I use the advanced debug system together with the "classic" JTAG tap (I use an Altera board, but I cannot use the virtual JTAG since there is a second NIOS-II-based system which uses the virtual tap). For a connection between my PC and the FPGA I use the ORSoC USB-JTAG-Debugger.

I know, that this setup is working, because it works together with the adv_jtag_bridge.

Now I want to switch the GDB-stub/server because of the inactivity of the adv_debug_sys-project.

For now I didn't get openOCD to work due to several problems. First one is, that I don't know, which git repo to use. there is the one official openOCD repo and the second made by Julius on github for the last ORConf. There are differences between both.

I did what one can find on the openOCD page of the OpenRISC wiki. But At first, it says, that the orsoc-jtag layout cannot be found and also the or1k-dev.tcl seems to have some problems, since there is an error in line 3 of the file about a wrong function call.

It would be great if I could get a starting point on how to get this combination to work. Of course I will answer every question which arises or clarify things.

Thank you very much!

Regards,
Martin
RE: OpenOCD with adv_debug_sys over ORSoC USB-JTAG-Debugger
by crevars on Jan 21, 2014
crevars
Posts: 29
Joined: Jun 7, 2008
Last seen: Mar 11, 2014
Hi,

You should use the official OpenOCD repository.

However, the problem is that the ORSoC USB-JTAG is not supported by OpenOCD. Creating the good configuration file for this interface shouldn't be hard...

Download OpenOCD source files then ./bootstrap && ./configure --ftdi (or --help to see which interface your want to include in the build) && make && make install

After that, install OpenOCD and start it with:

openocd -f interface/ftdi/ORSoC_USB-JTAG-Debugger.cfg board/or1k_generic.cfg

(Is you start OpenOCD from the sources root path you need to add -s ./ or prefix configuration files path with ./tcl/).

In the or1k_generic.cfg file, you need to change set TAP_TYPE VJTAG to set TAP_TYPE MOHOR.

I think Olof has already done the work for the ORSoC USB-JTAG interface.

Franck.



RE: OpenOCD with adv_debug_sys over ORSoC USB-JTAG-Debugger
by olof on Jan 22, 2014
olof
Posts: 218
Joined: Feb 10, 2010
Last seen: Dec 17, 2018
Hi,

Yes, I think I have a configuration file for the ORSoC JTAG debugger somewhere. I'll try to find it and post it. Unfortunately, I don't have the debugger anymore, so I can't test it.

//Olof
RE: OpenOCD with adv_debug_sys over ORSoC USB-JTAG-Debugger
by schafrichter on Jan 22, 2014
schafrichter
Posts: 10
Joined: Jul 9, 2009
Last seen: Nov 13, 2014
Hi Franck and Olof,

Thank you very much for clarification.

@Olof: It would be great if you could send me the file. And of course, I would give feedback if still everything is fine with the script and the ORSoC USB-JTAG-Debugger.

Martin
RE: OpenOCD with adv_debug_sys over ORSoC USB-JTAG-Debugger
by indirasulo on Jan 25, 2014
indirasulo
Posts: 29
Joined: Jan 12, 2012
Last seen: Sep 26, 2014
Are you talking about http://opencores.org/shop,item,3 ?
I've been running it with almost all combinations of dbg_if/adv_dbg_if and adv_jtag_bridge/OpenOCD(https://github.com/openrisc/openOCD)
RE: OpenOCD with adv_debug_sys over ORSoC USB-JTAG-Debugger
by indirasulo on Jan 25, 2014
indirasulo
Posts: 29
Joined: Jan 12, 2012
Last seen: Sep 26, 2014

Forgot to mention that I'm using adv_jtag_if from its OC svn, so I had to change JTAG TAP ID in openOCD:

diff --git a/tcl/target/or1k.cfg b/tcl/target/or1k.cfg
index cf4c0cf..2c24b5c 100644
--- a/tcl/target/or1k.cfg
+++ b/tcl/target/or1k.cfg
@@ -3,7 +3,8 @@ set _ENDIAN big

# force an error till we get a good number
# OpenCores Mohor JTAG TAP ID
-set _CPUTAPID 0x14951185
+set _CPUTAPID 0x149511c3

# jtag scan chain
# format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)

Or you can do orpsocv3 way: change JTAG TAP ID using parameter in verilog module instantiation.

RE: OpenOCD with adv_debug_sys over ORSoC USB-JTAG-Debugger
by schafrichter on Jan 26, 2014
schafrichter
Posts: 10
Joined: Jul 9, 2009
Last seen: Nov 13, 2014
Are you talking about http://opencores.org/shop,item,3 ?
I've been running it with almost all combinations of dbg_if/adv_dbg_if and adv_jtag_bridge/OpenOCD(https://github.com/openrisc/openOCD)


Yes, it is exactly this small piece of hardware. Currently I am trying with one of the generic USB FTDI interface scripts which comes with openOCD but I have problems, so it seams to be wrong. Problem you can help me out with the correct configuration of the ftdi minidriver in openOCD.

I handled the problem with the wrong TAP ID by changing it in the or1k-generic.cfg file in openOCD. But probably this is no good point to change it.

Further help would be appreciated.

Thank you very much!
RE: OpenOCD with adv_debug_sys over ORSoC USB-JTAG-Debugger
by indirasulo on Jan 26, 2014
indirasulo
Posts: 29
Joined: Jan 12, 2012
Last seen: Sep 26, 2014
Currently I am trying with one of the generic USB FTDI interface scripts which comes with openOCD but I have problems, so it seams to be wrong. Problem you can help me out with the correct configuration of the ftdi minidriver in openOCD.


What is the error message?
What arguments do you supply to ./configure? (see config.log if you don't remember)
Make sure that you have --enable-adv_debug_sys and you've read everything on http://opencores.org/or1k/OpenOCD

And dear Google please remember that I also got the following error when using OpenOCD with dbg_if:
ftdi_write_data "usb bulk write failed"
ftdi_wire_data -110

This was solved by using proprietary ftdi blob (--enable-ft2232_ftd2xx) instead of libftdi (--enable-ft2232_libftdi). By the way, openOCD+adv_jtag_if works well with both ftdi backends.
RE: OpenOCD with adv_debug_sys over ORSoC USB-JTAG-Debugger
by crevars on Jan 27, 2014
crevars
Posts: 29
Joined: Jun 7, 2008
Last seen: Mar 11, 2014
--enable-adv_debug_sys is not needed anymore in the upstream version of OpenOCD.

However, this version does not support the dbg_if (AKA classic Mohor debug interface). It could be done but as I detected some problems for 8/16 bits access to the WB bus, I decided to not include it.

@schafrichter: the configuration provided to you by Olof did work ?

Franck.
RE: OpenOCD with adv_debug_sys over ORSoC USB-JTAG-Debugger
by indirasulo on Jan 30, 2014
indirasulo
Posts: 29
Joined: Jan 12, 2012
Last seen: Sep 26, 2014
By the way, I have a question too: Now I have to restart OpenOCD each time I reconfigure my fpga, which is not very convenient. Can this be helped?
no use no use 1/1 no use no use
© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.