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:14 for --pins: TDI (GPIO2), TDO (GPIO3), TCK (GPIO4), TMS (GPIO14).

  • openFPGALoader with the libgpiod cable; version 0.13.1 has --read-dna, --read-xadc and --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, no dtoverlay=uart0… or dtparam=uart0 line, and no console=serial0 word 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.0 on a CM5 blade, 0000:01:00.0 on a CM4 blade. Check it with lspci.

    $ BDF=0001:01:00.0           # a CM5 blade; 0000:01:00.0 on a CM4 blade
    
  • The fpgas.online Acorn design’s .bit file in SOC:

    The design these steps load is the fpgas.online Acorn design, the only design a package installs. fpgas-online-acorn-bitstreams puts it in /usr/share/fpgas-online/acorn-pcie/images/, for each variant (cle-215p, cle-215, cle-101) as acorn-<variant>-sqrl_acorn.bit for a JTAG load, beside the two flash images. Put its name in SOC once per shell; the example is a CLE-101, so put another card’s variant in place of cle-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

  1. On the blade, run gpiodetect to find the header’s chip: pinctrl-rp1 on a CM5, pinctrl-bcm2711 on a CM4. Do not copy the Pi 5’s gpiochip15 link.

    $ gpiodetect
    
  2. On the blade, make that chip gpiochip0 if it is not already, because the libgpiod cable opens /dev/gpiochip0. Under kernel 6.18 the CM5’s chip is already gpiochip0.

    $ sudo ln -sfn /dev/gpiochipN /dev/gpiochip0   # N from gpiodetect; skip when the chip is gpiochip0
    
  3. On the blade, detach the card’s PCIe endpoint, so that the load cannot remove it under the host (why); lspci no longer lists the card.

    $ echo 1 | sudo tee /sys/bus/pci/devices/$BDF/remove
    
  4. 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
    
  5. 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
    
  6. 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,15 lists 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; dmesg says pin gpio14 already requested by 1f00030000.serial). Ask the site operator, then boot with the header’s serial port off (why).

  • --detect lists no idcode line, 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 … FAIL in under 0.1 s: the bitstream is gone, because /home/pi is 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.

Next