How to make a Compute Blade boot ready for JTAG¶
Your Compute Blade’s check fails at jtag although the wiring is right, or you want to know what to expect before you start: what has and has not been run on a blade, and the pin JTAG shares with the serial port.
What you need¶
a Compute Blade with a Compute Module 5, the Acorn and both cables fitted (How to fit the cables and the card (Compute Blade))
a login on the site’s gateway, the machine the blades boot from, with the right to change its boot files
a computer with ssh, on a network that reaches the blade
Steps¶
1. Decide which hosts get the change, with the gateway’s operator. The blade does not hold the two files this page changes: a host that boots from the network fetches them from the gateway. The gateway’s TFTP root, /srv/tftp/, has one symbolic link for each host, and the links point at one shared directory, /srv/nfs/rpi/trixie/boot/. So there are two ways, and the choice is the gateway operator’s:
Change the shared directory. Every host booting from it loses its console and login on the header’s serial pins, and the firmware’s boot messages there, from its next boot. To undo it, put the two files back as they were: the hosts go back at their next boot.
Give one blade its own copy of the directory. Only that blade is changed, from its next boot. To undo it, point the blade’s link back at
/srv/nfs/rpi/trixie/bootand, after asking the site operator, boot the blade again.
2. For the second way, find the name of the blade’s link. It is the last eight characters of the blade’s serial number. On the blade:
tr -d '\0' < /proc/device-tree/serial-number
3. For the second way, on the gateway, copy the shared directory, under any name, and point the blade’s link in /srv/tftp/ at the copy. For the first way there is nothing to do in this step.
4. On the gateway, keep a copy of config.txt and of cmdline.txt. Then make the two changes, in the shared directory (the first way) or in the blade’s own copy (the second way):
In
config.txt, in its[all]section, changeenable_uart=1toenable_uart=0. Also take out the lineuart_2ndstage=1(the firmware’s own boot messages on the header’s serial pins).In
cmdline.txt, which is one line, take out the wordconsole=serial0,115200.
5. Ask the site operator, then boot the blade again. A reboot ends a visitor’s session on the blade, the same harm as a power-off.
6. On the blade, install the packages again, as in How to run the Acorn check on a Compute Blade. On a blade whose root file system is in memory, the install is gone after the boot. Steps 7 to 9 run on the blade too.
7. Check that GPIO14 is free. No line of the last command may show a consumer (consumer="kernel") or [used]: that is a line the kernel will not hand out.
pinctrl get 2,3,4,14,15 # the function each pin is switched to
gpiodetect # the header's chip: `pinctrl-rp1` on a Compute Module 5
gpioinfo -c gpiochip0 | grep -E 'line +(2|3|4|14):' # with that chip's name (gpiod 2; gpiod 1: `gpioinfo gpiochip0`)
8. Check that nothing on the card drives GPIO14. Always run this step, on each blade you run JTAG on.
There are two reasons. A card that drives GPIO14 would drive against the blade’s own pin. A cable whose J2 wire has no 470 Ω resistor has nothing to limit the current. Note what pinctrl get 14 prints, then:
sudo pinctrl set 14 ip pd; pinctrl lev 14 # must print 0
sudo pinctrl set 14 ip pu; pinctrl lev 14 # must print 1
Then put the pull back as pinctrl get 14 showed it. Where it showed no pd, that is sudo pinctrl set 14 no pd.
9. Run the JTAG test, only if steps 7 and 8 passed:
sudo fpgas-acorn-verify --no-publish --test jtag
Check¶
jtag passes: it reads the FPGA’s IDCODE and its device DNA. In this boot there is no /dev/ttyAMA0. serial0 names ttyAMA10, the Compute Module 5’s own debug serial port, and the login prompt goes there. The header’s serial pins, GPIO14 and GPIO15, have no function and no user, so no program has to be stopped from using them.
If it fails¶
Step 7 shows a consumer on line 14: the header’s serial port is still on in this boot. Do not run JTAG. Read the two files the blade booted from, in the directory its link points at.
Step 8 does not print 0 and then 1: something holds or drives the JTAG TMS wire. Do not run JTAG.
p2-uart,p2-serialandscratchcannot pass in this boot: with the serial port off,/dev/ttyAMA0is not there.
Next¶
How to run the Acorn check on a Compute Blade: the whole check, which runs
jtagtoo.The Acorn check: why a card on a Compute Blade is not converted.
A failing Acorn test on a Compute Blade: from a failing
jtagline to the wire.