How to load a design onto an Acorn from its board page¶
You have an Acorn’s page open on welland.fpgas.online and a bitstream for it. You want the design to run, and to
see it. The load goes into the FPGA’s SRAM, so a reset brings back the image in the card’s flash. A reset or a reboot also empties /home/pi, uploads included.
What you need¶
An Acorn’s page, from the welland list: a board whose label says Acorn.
A
.bitfile for the card on that page, for example built for the CLE-215+.
Steps¶
Upload the file with the page’s upload button. It goes into
/home/pi/Uploads/on the host.In the page’s terminal, list the card; it shows one line, at
0001:01:00.0.$ lspci -nn -s 0001:01:00.0
Detach the card from the PCIe bus. The card no longer shows in
lspci. The host’s PCIe controller does not survive a load while the card is on the bus: the host drops your terminal and reboots.$ echo 1 | sudo tee /sys/bus/pci/devices/0001:01:00.0/remove
Make sure
gpiochip0is the header’s GPIO chip, because the loader’s cable opensgpiochip0.The header’s GPIO chip is the one
gpiodetectlists aspinctrl-rp1; its number varies from 11 to 15. Where the Acorn packages are installed, the boot check makesgpiochip0a link to it whengpiochip0is missing. The link is gone at each reboot. Check which chipgpiochip0is:$ sudo gpiodetect $ ls -l /dev/gpiochip0
Skip the link if
ls -lshows-> gpiochipNwith N the number ofpinctrl-rp1, orgpiodetectlistsgpiochip0itself aspinctrl-rp1. If/dev/gpiochip0is missing or another chip, link it. The line below is forgpiochip15: put your chip’s number in place of 15.$ sudo ln -sfn /dev/gpiochip15 /dev/gpiochip0
Load the design into SRAM. Put your file’s name in place of
design.bit.$ openFPGALoader --cable libgpiod --pins 10:9:11:8 Uploads/design.bit
Rescan the bus and list the card again. A design with a PCIe endpoint shows one line. A design without one shows none, and the card stays off the bus until a Reset loads its flash image again.
$ echo 1 | sudo tee /sys/bus/pci/rescan $ lspci -nn -s 0001:01:00.0
Check¶
The load’s last line ends with done 1. With done 0 the FPGA is not configured, whatever the exit status; the
STAT register printed under it says why. Then watch the card’s LEDs on the page’s camera.
If it fails¶
What you see |
Likely cause |
Fix |
|---|---|---|
The terminal drops during the load, and the host reboots |
the card was still on the PCIe bus |
wait for the host to come back (press Reset, as on How to reset a board, if it does not), then follow the steps again from step 1: the reboot emptied |
|
the FPGA did not configure |
read the STAT register printed under it, and check that the file was built for the card the page names |
More causes are on How to check an Acorn’s PCIe link by hand on a Raspberry Pi 5.