Electronics

Raspberry Pi JTAG Programming – 2025 Edition

It seems that every time I document how to do Xilinx JTAG programming from a Raspberry Pi, they change something to break it. So, it is time to update the instructions again.

History

The main problem is when using xc3sprog. The original method used wiringpi in the Buster version of Pi OS to talk to the GPIO. Then the Bullseye version came around and wiringpi was removed in favour of sysfsgpio. I believe in-part due to the way the Pi 5 GPIO works, this was no longer viable, so with Bookworm, there is another method libgpio. In addition, wiringpi is back and also should work!

I should probably note here that if you are confused about the Pi OS naming, it is based on Debian. Debian names each release after Toy Story characters.

How to use libgpio

The original xc3sprog repository appears to be no longer developed or taking contributions. I was going to fork it and add support for libgpio, but someone beat me to it. You can find their repository here.

As a refresher, this is the pinout of the Pi GPIO, this is the same for most generations of Raspberry Pi, apart from the first original one:

You should wire it up as follows:

Pin NumberGPIO NumberFunction
74TMS
9GND
1117TCK
1327TDO
1522TDI
173.3v

Now, to install the software, open a shell or SSH into the Pi and do the following:

sudo apt update
sudo apt install build-essential libusb-dev libftdi-dev libgpiod-dev git cmake
git clone https://github.com/arkadiuszmakarenko/xc3sprog.git
mkdir xc3sprog/build
cd xc3sprog/build
cmake ..
make
sudo make install

This should get you the software installed. From here you can check if the JTAG chain works by using:

sudo xc3sprog -c gpiod_creator -j

This should give you a list of JTAG devices connected. JTAG works in a chain from ID 0, so multiple chips can be programmed from a single connector.

From here you can program your chips using:

sudo xc3sprog -c gpiod_creator -v -p {chain position starting from 0} {filename}.jed

That is it! You should get a successful flash!

LinuxJedi

View Comments

  • Thanks for keeping this as updated as possible. But I still run into errors with this guide :(

    Hope you can suggest a solution. I'm not really knowledgable about all these linux packages & dependencies.

    Thanks!

    • Oh I do need to list the error of course:

      W: Sources disagree on hashes for supposedly identical version '3.25.1-1' of 'cm ake-data:arm64'.
      E: Can't find a source to download version '3.25.1-1' of 'cmake:arm64'
      W: Sources disagree on hashes for supposedly identical version '0.17029-2' of 'l iberror-perl:arm64'.
      E: Unable to parse package file /var/lib/apt/lists/deb.debian.org_debian_dists_b ookworm_main_binary-armhf_Packages (2)

      • This looks to be an issue with Raspbian's repositories. There isn't much I can do about that. Please try `sudo apt-get update` and try again. If that doesn't work, it might be a waiting game of a couple of hours until the mirrors are working again.

        I'll update the instructions to add that step anyway.

  • I try to check the toolchain as
    sudo xc3sprog -c sysfsgpio_creator
    and, according to your page, as
    sudo xc3sprog -c gpiod_creator -j
    But in both variants I only get
    Can't find description for a cable named xxxxx
    and then a list of 37 known cables starting from
    ftdi ftdi 1500000 0x0403:0x6010:
    up to
    tumpa ftdi 1500000 0x0403:0x8a98:TIAO USB Multi-Protocol Adapter:1
    I try to connect to a JTAG device from a RasPi Zero 2W.

    • Never mind... I rebooted, repeated the installation, rebootet again and now I get:
      JTAG loc.: 0 IDCODE: 0x59608093 Desc: XC95144XL Rev: E IR length: 8
      :-)))

Recent Posts

Why Recapping Isn’t Always the Cure: And Amiga 1200 Repair Story

I often see on places such as Facebook that an Amiga owner will show a…

2 weeks ago

KDE Plasma Automatic Time Zone

I have been a full time KDE Plasma user for quite a while now. Whilst…

3 weeks ago

The wolfDemo Board Story: From Idea to Reality

I work building open-source cybersecurity solutions for wolfSSL. These solutions often involve embedded environments, which…

4 weeks ago

Upgrading the RAM Detective: A Firmware Adventure with RAMCHECK

The firmware in my RAMCHECK is very old, there were many updates since then. Unfortunately,…

4 months ago

The Ultimate RAM Detective: Meet the Innoventions RAMCHECK

Whilst repairing vintage machines, a lot of RAM passes by my benches. Most of it…

4 months ago

Vintage Speed Demon: Fixing an ARK1000VL Graphics Card

According to some, the ARK1000VL is considered the fastest VLB graphics card chip you can…

5 months ago