BusPirate / Bus_Pirate

Community driven firmware and hardware for Bus Pirate version 3 and 4
625 stars 130 forks source link

jtag on bp 3a #102

Closed pljakobs closed 6 years ago

pljakobs commented 6 years ago

So I have successfully built and flashed v7.1 from this repo, but could not find jtag among the protocols. From what I gather, it should be available for v3 hardware - is it no longer configured through the modes menu?

Also, I know the flash memory of the pic on the v3 boards isn't sufficient to hold a single binary with all features, it would be excellent to have a choice, which features to build to create a personalized set.

agatti commented 6 years ago

As far as I know, JTAG is meant to be used only via the binary I/O protocol. I checked the source code for version 6.1 as it came out from dangerousprototypes' git repository and there is no trace of a command line-driven JTAG mode.

pljakobs commented 6 years ago

hmm.. maybe I was mistaken then, I thought I had seen jtag in the protocol selection menu in some tutorials.

marsfan commented 6 years ago

I believe at one point there was an alternative firmware that had a JTAG mode. I seem to recall trying it and not having much luck, but I believe that was because I have no clue how to use JTAG.

USBEprom commented 6 years ago

@pljakobs

As Marsfan wrote due lack of available memory in the 24FJ64GA002 PIC used on Bus Pirate v3, the JTAG feature have been treated as alternative firmware just like the AVR programmer and other stuff like that. Of course agatti too wrote correct in his reply, so the whole thing is explained here:

http://dangerousprototypes.com/docs/JTAG

As it is possible to read it exists a specific alternative firmware that makes it possible to manage the JTAG protocol with the Bus Pirate, it is called XSVF Player and can be found here:

https://github.com/BusPirate/Bus_Pirate/tree/master/Firmware-Alternates

However, it is also clearly stated that starting from version 5+ and going up, Bus Pirate firmware includes support for the OpenOCD JTAG debugger and this is the much better option in order to work JTAG:

http://dangerousprototypes.com/docs/Bus_Pirate#JTAG_and_OpenOCD

Community Firmware v7.1 too has JTAG support enabled, so it will work without any problem out of the box. I own a Bus Pirate v3 running U-07012018-1.hex (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=90#p67351) and OpenOCD works like a charm. The OpenOCD I use is this:

http://dangerousprototypes.com/forum/viewtopic.php?f=4&t=8629

marsfan commented 6 years ago

@USBEprom Can you clarify this statement for me

alternative firmware just like the AVR programmer

Are you referring to the STK500 emulator or avrdude integration? Because I though avrdude could directly interact with the bus pirate standard firmware.

USBEprom commented 6 years ago

@Marsfan

Yes, of course I meant STK500 emulator because for the same reason of the JTAG feature, lack of available memory into 24FJ64GA002 PIC used on Bus Pirate v3, firmware-STK500v2 too has been pushed as alternative:

https://github.com/BusPirate/Bus_Pirate/tree/master/Firmware-Alternates

However you are fully right, avrdude could directly interact with the Bus Pirate standard firmware, v7.1 too. I used avrdude as shell and as GUI without any problem.

agatti commented 6 years ago

STK500 will probably be removed in the next repository cleanup, as I am not even sure it still compiles. Is there any reason for us to keep this around?

marsfan commented 6 years ago

@agatti All I can say regarding the STK500 is when I tried to use it about a year ago with Atmel Studio, Atmel Studio did not recognize it as a STK500 device.

agatti commented 6 years ago

@Marsfan Fair enough, those will be gone in 7.2 then.