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 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

Recent Posts

The Legend Continues: Amiga 1000 Keyboard Revival

I have restored the boxed Amiga 1000 main unit and the mice that came with…

1 day ago

Amiga 4000 Repair: This one was just weird

I was recently sent an Amiga 4000 motherboard repair. It should have been quite straightforward,…

3 days ago

Unboxing the Legend Continues: Amiga 1000 Mouse Restoration.

I recently received a boxed Amiga 1000 which was in excellent condition, but required a…

1 week ago

Unboxing a Legend: Amiga 1000

I have a local friend who is a private collector of vintage computers and consoles,…

2 weeks ago

Amiga 4000 With Lots of Little Problems

I’ve had a few people send me things in to repair lately. Amongst these was…

2 months ago

Amiga A3640 CPU Card Repair

Lately, I've been very busy, but haven't had many interesting things to blog about happen.…

2 months ago