blueTag (JTAGulator alternative) port to Bus Pirate

There are a couple items on my end of year list, including some kind of JTAG interface discovery. I was originally planning to add it as a JTAG mode to the main firmware, but time and licensing mean that won’t happen for a while.

  • JTAGulator - The gold standard. CC-BY license, but written in spin for parallax.
  • blueTag - JTAGulator clone on RP2040, but licensed GPL (so no integration)
  • JTAGenum - Arduino JTAG finder, license not mentioned.
  • arduinull - Arduino JTAG finder, license not mentioned, but very short (200 lines)

To meet my year end goal, I think the best bet is to port blueTag to the Bus Pirate hardware as another external firmware. I cannot integrate it directly because it is GPL licensed, or at least that is my understanding.

After I get familiar with JTAG again, and have targets to test against, I’ll add a native JTAG mode to the main firmware.

4 Likes

I use blueTag on one of my spare Picos. I like it because it will also look both SWD and JTAG, which the JTAGulator doesn’t do.

I used the JTAGulator at work, and the only thing I miss about it when using my janky blueTag setup is that I’m 3.3V specific because I don’t have any level shifters - just right into the GPIO ports. it would be sweet to run it on the BP hardware to take care of that.

3 Likes

I noticed the SWD stuff in the code, and thought that was a bonus. Especially becaiae it’s half the code which made the 1200 line file less intimidating :slight_smile:

2 Likes

Oh wow, the blueTag author is a Bus Pirate user and changed the license so we can integrate it directly. Thank you so much Aodrulez!

8 Likes

I believe the JTAGulator release 1.12 supports GPIO, JTAG, SWD, UART scanning - thanks to samyk

2 Likes

i was actually looking at this GitHub - gremwell/go-jtagenum: JTAG enumeration tool written in Go. A port of https://github.com/cyphunk/JTAGenum enhanced with https://github.com/grandideastudio/jtagulator improved implementation.

I took a moment to go add an issue in GitHub for tracking the feature requests. Happy to be a test monkey :monkey:

2 Likes

Thank you :slight_smile: This is next on my list when I get the infrared mode stuff completed. Hopefully this weekend or Monday, depending on how difficult it is to capture the modulation frequency (it’s not going great).

1 Like

Happy to help - if I knew what you were talking about I’d take a stab at it :grin:

1 Like

I think I have it figured out. Want to get the Infrared adapter going. So very close.

4 Likes

There is a new mode to host bluetag, xsvf players, etc. It doesn’t do much at the moment, but I’ll build on here.

blueTag was added to /lib/, and I’ll create a command to control it in /commands/jtag/bluetag.c.

Work in progress, nothing usable yet.

2 Likes

blueTag command line interface is working in JTAG mode. It doesn’t do much yet, but that’s next.

I’m trying to do minimal changes to blueTag to stay in sync with the upstream project. So far I’ve added a helper function and extern’ed a variable via a .h file. The display uses \n instead of \r\n though, so it’s gonna get dicey.

2 Likes

nice…two jtag’s at one :wink:

1 Like

Formatting aside (last thing to do), the SWD part of bluetag is now working in JTAG mode. Here it detects a RP2040 PICO board.

There are a lot of global variables, which is fine for how bluetag is intended to be used as a stand alone script. I switched everything over to a struct that is passed around to keep it a bit more contained in the Bus Pirate firmware.

Tomorrow I’ll get the JTAG finder going, I hope.

3 Likes

As to the "\r\n" vs. "\n" thing … isn’t there a terminal (client) setting that allows you to make them essentially equivalent?

Or, is blueTag actually using newline to get to the next line without changing position on that line? (if so, it’s rare to see software relying on that these days…)

1 Like

I use tio, which has such settings available.

2 Likes

I’ll have to look. Historically there is a reason we use rn, but I don’t recall why.

I’d really like to get it to a place where the display of findings is totally unlinked from the finding process, but with minimal impact on the original fork.

The other thing I’m pondering is an optional pre check to filter out ground or power pins. Pull a pin high and low, if it is stuck at either mark it for skip. Optional of course.

1 Like

FWIW, if you use my BusPirate/BusPirateSetup script, it tries to set up the terminal software correctly. For example, for tio, it uses
tio -n --map INLCRNL,ODELBS -b $BAUD $PORT

4 Likes

JTAG scan is working. Horrible debug that ended up being a missing | in a |=.

Made some heavy updates to the code and did a draft pull request to the blueTag project for discussion.

Next I’ll complete the integration which should be done soon.

2 Likes

blueTag command line interface is now working. I’ll push the firmware shortly:

  • Enter JTAG mode
  • Enable a power supply
  • Use the bluetag command to access the blueTag CLI.

It can scan for booth JTAG and SWD pins:

  • Type s or j
  • Enter the number of connected pins, starting from IO0. I’m using IO0-IO4 (5 pins)
  • blueTag searches for a JTAG or SWD interface.

Next I’ll add flags and options to the command so it can be used independently of the blueTag cli.

1 Like