JTAG Support on Bus Pirate v5

Hello!

I have been looking for a good general purpose JTAG probe, and was lead to the Bus Pirate 3 and have stumbled upon the v5. It looks like a massive upgrade over the v3. However, I can’t find much mention on JTAG support or anything in the firmware repo.

Any plans on JTAG support for the v5?

Any way me (or others) can jump in and assist?

Will an adapter cable be made available from the main (or aux) connector to common ARM style 10 pin JTAG connector?

Very exciting project and very keen to see how it progresses!

Thanks!

Hi ehawk,

Binary mode things like JTAG are still in progress. I’m porting everything from v3 to v5, but we’ve hit some manufacturing issues the last few weeks.

I recently had a query about this on twitter as well, and looked into porting the pico probe, which was no issue. However, this is an SWD style jtag device and it seems like you want the full JTAG interface.

In general though, I’d probably get a “knock-off” dedicated JTAG debugger if were doing a lot of debugging. The Bus Pirate has always been a good multitool that saves the day in a pinch, but for programming and debugging it will never be as fast as a dedicated device like a segger (clone?).

Cheers,

Ian

Thanks Ian,

I have looked around at other debuggers, but the cheaper one’s are all the vendor specific ones, which is a problem because I have a large amount of random dev boards from the last 20 years.

I’m not really interested in counterfeit probes, and a lot of the cheap community probes as you found are SWD only.

The BP5 still looks really appealing with it’s ubiquitous and powerful RP2040 and wide voltage IO, I’ll wait until all the kinks are worked out and look into adding my own JTAG support to BP5 with OpenOCD support.

Cheers,
Ethan

1 Like

Hi Ethan,

I have looked around at other debuggers, but the cheaper one’s are all the vendor specific ones, which is a problem because I have a large amount of random dev boards from the last 20 years.
I’m not really interested in counterfeit probes, and a lot of the cheap community probes as you found are SWD only.

I hear you on that. Accessing random old boards with various chips in a pinch is definitely the Bus Pirate JTAG use case.

Bus Pirate v3 Open OCD should be fairly well supported, it’s been in the Open OCD code for years at this point. The code isn’t particularly complicated, though at some point someone contributed optimized ASM code and that would have to be reworked:

I just got the revision with a NAND flash chip working a few moments ago (USB MSC buffer size was the issue, it’s always simple in the end). The tooling people called this morning, and we’ll be making plastic at 7am my time tomorrow. The final touch is testing the new op-amp buffer on the analog mux when I get the board this week. We’re really really close to being done.

My desk is littered with engineering samples. If you’d like to have a look at Open OCD support I can mail you one.

Cheers,

Ian

Hey Ian,

I am more than happy to help, but I’m in Australia so shipping might be expensive when the final product is close to completion, I’m happy to pay for a production model, but if you don’t mind sending one, I’d be glad to start work on OpenOCD support.

Cheers,
Ethan

1 Like

Ah, my poor assumption. I thought from the time of your replies you might be in EU area. It would probably take a while to mail you one from here.

We opened an aliexpress shop to take advantage of their incredible logistics and it’s working well for “remote” locations. Though, on Friday we realized we can use Cai Naio directly, so we are working on that as well. If we manage to get it going, would you be interested in receiving one of the engineering samples from the Shenzhen office to help us test the shipping? No charge, it could go horribly horrifically wrong :slight_smile:

Haha sure, I can DM you my shipping address (I assume).

Yes, please :slight_smile: I see your chat.

Hi Ian

Can you pass me the link to your Aliexpress store so I can save it in my favorites?

Thank you

The Bus Pirate Store :slight_smile:

2 Likes

I am also looking for OpenOCD support. I have one device that has only JTAG pins nothing else. I dag into documentation and found out a pinout. Now reading OpenOCD manual. So @ehawk I have a hope in you!

1 Like

I’m going to make a big JTAG push. Jtagulator, OpenOCD (dirty JTAG), and pico probe.

The hardware and docs sucked up a lot of time, but I’m back into it now.

2 Likes

Nice @ian I just saw a video called Beers in Bunnie’s Workshop - Workshop Video #36. Two legendary hardware hackers together. I get lots of inspiration to continue with my projects

1 Like

If you wanted a fully supported JTAG debugger, I was going to suggest the Segger J-Link EDU ($70 USD) as it is identical to the J-LINK BASE ($495) except for the terms of service. But today I was surprised(!) that they discontinued the EDU discount (and terms). They still have the J-LINK Mini EDU ($60). It supports both the J-LINK software (and the GDB debugger) and OpenOCD. It should be able to debug the BP5 as well.

Adding to this discussion:

Adding for reference: GitHub - Aodrulez/blueTag: JTAGulator alternative based on Raspberry Pi Pico

1 Like

Nice find! I had been looking at the old one. I’ll pull this and start poking around.

1 Like

Here’s the Pico Probe SWD firmware working on the Bus Pirate, which I believe is a general purpose cmsis ARM debugger at this point.

I realize how badly we need a Bus Pirate library to pull in power supply, buffer control, and pull-ups into ports easily.

For ports like this: I think the “just one button” pressed at power up should jump to bootloader, so it’s easier than sticking a thing in the bootloader button hole on the bottom.

I submitted a couple bug reports for the Pico Probe firmware. I’ll fork their repo, apply my changes, and setup an auto-build for this port ASAP.

Which of the other 3 JTAG/RP2040 projects should I dig into next?

2 Likes

media_20240201_142057_6052283281161391921

Pico Probe is Raspberry Pi’s ARM CMSIS 2-wire JTAG debugging firmware, supported by OpenOCD. It was a relatively easy port to Bus Pirate 5 b/c a version of the PIO program already manages Output Enable for buffers. I just had to make it bi-directional and invert the OE pin to work with BP5.

  • SWCLK is pin IO0
    -SWDIO is pin IO7
  • UART TX is IO4
  • UART RX is IO5
  • An external power supply must be applied to the VOUT/VREF pin. I used the onboard power supply from the Pico dev board to power the BP5 buffer.

Code is in the repo. There’s still some work to do. It’s clear I need a Bus Pirate “library” to include in projects like this for easy use of buffers, power supply, pull-ups, LCD, and perhaps storage.

Here’s a firmware compile for now, latest is in the repo:

picoprobe.zip (40.5 KB)

2 Likes

If you are interested in a PIO mode for JTAG, I have one in the following repo:
phdussud/pico-dirtyJtag (github.com)
Look at jtag.pio and pico_jtag.*

1 Like