JTAG dongle pushes code to FPGA after bootup

This gnarly beast has near-magical qualities. [Sprite_TM] patched it together as a dongle which attaches to a JTAG header (we’re fairly certain this is not a standard footprint for that interface though). He uses it to push code to an FPGA after that device boots. Why? Well, there’s several reason, but the most generic answer is that some boards will not boot unless there is a chain of trust that validates the code which will be running.

In this case, [Sprite_TM] is using a knock-off board he acquired from a Chinese supplier. It’s a hardware network terminal (thin client), and as you can see in the video after the break, it works just fine. But that’s pretty boring and he wanted to use it for his own purposes. When he plugs in the dongle and powers up the board the network terminal is nowhere to be found, replaced with the code to play Pac-Man as if were a full arcade cabinet.

The dongle is simply a female DIL header, an ATtiny85, and a flash memory chip. The AVR has a software UART that speaks XSVF, the protocol used to push data to the FPGA. The data to be written is stored in the memory chip, and with that header in place reprogramming the AVR is just a matter of connecting an ISP programmer. Brilliant!

[youtube=http://www.youtube.com/watch?v=s0boi8KJw6g&w=470]

Comments

  1. Lovely! Can the AVR talk to the fpga normally after?

    • nuess0r says:

      Generally not, because the AVR is connected to the FPGA by the JTAG interface. This interface is not meant to communicate between devices in normal operation.

      But it would be possible, because inside the FPGA you can access the JTAG interface registers and implement additional JTAG registers and command statemachines as you need and like. It will be rather slow but when the AVR is fast enough for your application, still a possible way.

      Simpler for a new design use a Lattice MachXO2, it has a SPI interface for interfacing with Microcontrollers and to download new FPGA programming files. No special hacking needed, quite elegant IMO.

  2. HackerK says:

    Now this is real hacking and the stuff I wanted to see more at HaD!

  3. JB says:

    Brilliant indeed!

  4. ultrasounder says:

    Ingenious. I was looking for something like this.

  5. smoketester says:

    Not into FPGA’s yet but something like this is a TRUE HACK! Love it for that reason alone. GO Dude!

  6. War_Spigot says:

    Record amount of acronyms for a HaD post? I count 12. More acronyms=more goodness

  7. MattE says:

    Yay, great! This is something I’ll have to do on one board I have, thanks for trailblazing 🙂

  8. Drone says:

    JTAGWhisperer plays XSVF files to your FPGA/CPLD from an Arduino (yeah I know – yech!). It uses code ported from the PIC based Bus Pirate XSVF player.

    https://github.com/sowbug/JTAGWhisperer

    Not my project…

  9. blorg says:

    Yeah really nice, I want to see more of this on hackaday (or at least less other “easy stuff” that will only fill my news feed with stuff I have to skip)

Speak Your Mind

*

Related Hacks in Microcontrollers

  • Morse Code interpreter
  • One wire reads the keypad from the APRS radio mic
  • Level conversion with plenty of options
  • Music visualization generator with a Propeller
  • Metal detection using an inductor instead of a clock crystal.