How to run JTAG by hand on an Acorn on a Compute Blade¶
You have an Acorn wired to a Compute Blade and want to see its JTAG answer, then load a design over it.
This page is for a blade the site operator has taken out of service for it; on a blade in the fleet the load is not run (test-designs #241, #237).
Which wire goes where is on Acorn wiring on a Compute Blade. The line JTAG shares with the serial pair is on The line JTAG and the serial port share on a Compute Blade. On a Raspberry Pi 5 the commands differ: How to run JTAG by hand on an Acorn on a Raspberry Pi 5.
This procedure is waiting for its run: test-designs issue #237.
What you need¶
An Acorn wired as on Acorn wiring on a Compute Blade, on a blade with a CM4 or a CM5.
The pin order
2:3:4:14for--pins: TDI (GPIO2), TDO (GPIO3), TCK (GPIO4), TMS (GPIO14).openFPGALoaderwith thelibgpiodcable; version 0.13.1 has--read-dna,--read-xadcand--read-register, all read-only.The header’s serial port off in this boot:
The header’s serial port off in this boot:
enable_uart=0, nodtoverlay=uart0…ordtparam=uart0line, and noconsole=serial0word on the kernel command line. Under kernel 6.18 JTAG cannot run otherwise (why); under kernel 6.12 it also answers with the serial port on. In the serial-off boot there is no serial pair to test. Setting it takes a boot of the blade: ask the site operator first, because a reboot ends a visitor’s session on the blade.The card’s PCI address in
BDF:The card’s PCI address in
BDF, set once per shell:0001:01:00.0on a CM5 blade,0000:01:00.0on a CM4 blade. Check it withlspci.$ BDF=0001:01:00.0 # a CM5 blade; 0000:01:00.0 on a CM4 blade
The fpgas.online Acorn design’s
.bitfile inSOC:The design these steps load is the fpgas.online Acorn design, the only design a package installs.
fpgas-online-acorn-bitstreamsputs it in/usr/share/fpgas-online/acorn-pcie/images/, for each variant (cle-215p,cle-215,cle-101) asacorn-<variant>-sqrl_acorn.bitfor a JTAG load, beside the two flash images. Put its name inSOConce per shell; the example is a CLE-101, so put another card’s variant in place ofcle-101, here and in the release file names of the loopback and pin-ID designs:$ SOC=/usr/share/fpgas-online/acorn-pcie/images/acorn-cle-101-sqrl_acorn.bit
Steps¶
On the blade, run
gpiodetectto find the header’s chip:pinctrl-rp1on a CM5,pinctrl-bcm2711on a CM4. Do not copy the Pi 5’sgpiochip15link.$ gpiodetectOn the blade, make that chip
gpiochip0if it is not already, because thelibgpiodcable opens/dev/gpiochip0. Under kernel 6.18 the CM5’s chip is alreadygpiochip0.$ sudo ln -sfn /dev/gpiochipN /dev/gpiochip0 # N from gpiodetect; skip when the chip is gpiochip0
On the blade, detach the card’s PCIe endpoint, so that the load cannot remove it under the host (why);
lspcino longer lists the card.$ echo 1 | sudo tee /sys/bus/pci/devices/$BDF/remove
On the blade, read the IDCODE with a read-only
--detect, which is safe without step 3; it prints the IDCODE. Then put the pins back, because openFPGALoader leaves GPIO2 and GPIO4 as outputs driving low.$ openFPGALoader --cable libgpiod --pins 2:3:4:14 --detect $ pinctrl set 2,4 no pu
On the blade, load the design into SRAM and put the pins back again; the load’s last line ends with
done 1.$ openFPGALoader --cable libgpiod --pins 2:3:4:14 $SOC $ pinctrl set 2,4 no pu
If this boot has the serial port on, give GPIO14 and GPIO15 back to the serial port with the line for your module. Do this only when the loaded design treats J2 as an input: the fpgas.online design does, pin ID does not. The UART function differs per module, and
pinctrl funcs 14,15lists them.On a CM4 (BCM2711), GPIO14 is TXD0 and GPIO15 is RXD0 at
a0:$ pinctrl set 14,15 a0
On a CM5 (RP1), they are TXD0 and RXD0 at
a4:$ pinctrl set 14,15 a4
Check¶
Step 4 prints the IDCODE of the chip. After step 5 the FPGA runs the design. The PCIe page confirms it by bringing the endpoint back.
idcode 0x3631093 (XC7A100T, an Acorn CLE-101 or LiteFury)
idcode 0x3636093 (XC7A200T, a CLE-215+ or NiteFury)
Never pass --write-flash here. An SRAM load is lost at power-off, so a reboot restores whatever is in flash.
If it fails¶
gpiod_line_request_set_values_subset: Assertion 'request' failed: the serial driver holds GPIO14 (enable_uart=1;dmesgsayspin gpio14 already requested by 1f00030000.serial). Ask the site operator, then boot with the header’s serial port off (why).--detectlists noidcodeline, or prints nothing: the P1 cable is unmated or miswired; check TCK for the Acorn’s pull-up and reseat P1.JTAG fails with
--pins 10:9:11:8: that is the Pi 5’s pin order; use--pins 2:3:4:14.Open file … FAILin under 0.1 s: the bitstream is gone, because/home/piis a memory overlay that loses its files at reboot; copy it again.The UART is dead after JTAG: openFPGALoader left GPIO14 an output; run step 6 for your module.