Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OpenOCD support for v4 #28

Closed
agatti opened this issue Nov 1, 2016 · 16 comments
Closed

Add OpenOCD support for v4 #28

agatti opened this issue Nov 1, 2016 · 16 comments
Assignees
Milestone

Comments

@agatti
Copy link

agatti commented Nov 1, 2016

OpenJTAG support is currently only enabled for v3. There were some earlier attempts at porting said code to v4 but nothing stable ever came out of it, as far as I know.

@kallisti5
Copy link

I remember trying to get JTAG going on the BPv4 a few years back... I thought it worked, but then I got a FlySwatter 2. Must of not worked very well :-|

@agatti agatti changed the title Add OpenJTAG support for v4 Add OpenOCD support for v4 Nov 12, 2016
@agatti agatti added this to the 7.2 milestone Nov 14, 2016
@csholmq
Copy link

csholmq commented Dec 26, 2016

I've gathered only v3 is supported by OpenOCD. But now with discontinued firmware by DP and compilation errors in the community build, it would be super if support could be added for the v4!

@agatti agatti self-assigned this Dec 28, 2016
@agatti
Copy link
Author

agatti commented Dec 28, 2016

@csholmq indeed, I believe most BP users got theirs mostly for JTAG support. It'd be a bummer if v4 could not handle it...

@csholmq
Copy link

csholmq commented Dec 28, 2016

Is OpenOCD supported through binary mode?

@agatti
Copy link
Author

agatti commented Dec 28, 2016

That is the only way to access OpenOCD actually. When OpenOCD starts, it sends a particular command sequence to the serial port that first puts the BP into bitbang I/O mode (20 x 0x00) and then sends the proper command to enter OpenOCD mode (0x06). There is no way to access that from the serial command interface (wouldn't be that much useful after all).

@agatti
Copy link
Author

agatti commented Dec 28, 2016

By the way, that's on v3. On v4 sending that command sequence will do nothing, which is what I plan to fix in the near future :)

@valholl
Copy link

valholl commented Nov 19, 2017

I see that there is no update on this issue since last year: are there news?

I need a JTAG programmer and was considering buying a bus pirate, and I wanted to know if I should buy a v3 or if in the month or so that international shipping can take I'm going to read that support has been added for v4 and regret my purchase :)

@agatti
Copy link
Author

agatti commented Nov 20, 2017

Hi there, unfortunately your best bet is to get a v3 right now. OpenOCD for v4 is scheduled for v7.2, which is scheduled sometime early next year at least. Right now we're stuck in figuring out the best way to provide a smooth upgrade path from the old firmwares to this one, and that seems to be tricky to handle in an optimal way...

@agatti
Copy link
Author

agatti commented Jul 2, 2018

Well, this took some time but can some of you folks who asked for OpenOCD support on v4 check whether this branch does work for you?

@agatti
Copy link
Author

agatti commented Jul 4, 2018

Ok, this just got merged - please give mainline a shot instead so maybe more people might be able to try this out. I'll close this for the time being, please re-open another bug if the code doesn't work for you.

@agatti agatti closed this as completed Jul 4, 2018
@robsoncouto
Copy link

Hello
First of all, thanks for all your work into this project.

I wanted to try this but could not get it to work. Could you kindly share your configuration script for the Bus Pirate v4?
I believe I installed the firmware correctly. The interactive terminal (?) says:

HiZ>i
Bus Pirate v4
Community Firmware v7.1 - goo.gl/gCzQnW [HiZ 1-WIRE UART I2C SPI 2WIRE 3WIRE KEYB PIC DIO]
DEVID:0x1019 REVID:0x0004 (24FJ256GB106 UNK)
http://dangerousprototypes.com
HiZ>

When trying to run openocd, i get the following:

$ openocd -f /usr/local/share/openocd/scripts/interface/buspirate.cfg -f nuv.cfg 

Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Error: The specified debug interface was not found (buspirate)
The following debug interfaces are available:
1: ftdi
2: usb_blaster
3: presto
4: usbprog
5: openjtag
6: jlink
7: vsllink
8: rlink
9: ulink
10: arm-jtag-ew
11: hla
12: osbdm
13: opendous
14: aice

I have used openocd before with a ft2232 board (not seriously, just some firmware dumps), but this is the first time I use a Bus Pirate for anything.
I appreciate any help with this :)

@JarrettR
Copy link

JarrettR commented Oct 1, 2018

Have you compiled OpenOCD with the --enable-buspirate flag?

I assume it still works something like this:

http://dangerousprototypes.com/docs/Gonemad%27s_Bus_Pirate/OpenOCD_walk_through

@robsoncouto
Copy link

Thanks for your quick answer and sorry for the trouble!
I was just editing my post, but will reply here.
Yes, just got it to work with the flag. Just was not aware I had to reconfigure openocd. Now it recognizes the cpu.

Still, may I ask another question? It is possible to use the extra auxiliary pins on the v4 to drive the reset signals? If I understand correctly, the v3 can drive SRST or TRST only?

Thanks again

@agatti
Copy link
Author

agatti commented Oct 1, 2018

The v4 uses AUX0 for SRST and AUX1 for TRST. Is there another signal you need to be driven through AUX2?

@robsoncouto
Copy link

Hello. Thanks for your reply!
No, just SRST and TRST. The board I am trying to debug has both and was not being able to halt the cpu previously. I will try it out with both signals and the updated config file as soon as possible.

Thanks again

@tudstudent
Copy link

tudstudent commented Nov 6, 2018

Could someone clarify if JTAG is now working correctly on V4, on this website it states it cannot:
http://dangerousprototypes.com/docs/Bus_Pirate_v4_vs_v3_comparison

On this mentioned website:
*What doesn't work on Bus Pirate v4 right now:

  • **OpenOCD JTAG mode**
    
  • STK500v2 AVR programmer
    
  • XSVF player JTAG programmer 
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants