How to load a design into a NeTV2 on a Raspberry Pi 5¶
You want to load a bitstream into a NeTV2’s FPGA on a Raspberry Pi 5, over GPIO JTAG with openFPGALoader.
The load goes to the FPGA’s SRAM and is lost at power-off. A NeTV2 on a Raspberry Pi 3B+ is on its own page.
This procedure is waiting for its run: test-designs issue #246.
Warning
Reconfiguring the FPGA over JTAG while its PCIe endpoint is enumerated is a surprise removal, and it crashes the BCM2712 root complex. Step 2 detaches it.
What you need¶
A NeTV2 wired as on NeTV2 wiring to a Raspberry Pi, with its PCIe link in the Pi 5’s PCIe connector.
The
openfpgaloader-fpgasonline-gitpackage, which carries therp1piocable (What runs on a Pi host). The apt repository is added as on fpgas-verify: installing it.A bitstream, here
design.bit.
Steps¶
On the Pi, run
lspci -D -s 0001:01:00.0, the Pi 5’s PCIe slot. A line there is an endpoint to detach; no line, go to step 3.On the Pi, detach it with
echo 1 | sudo tee /sys/bus/pci/devices/0001:01:00.0/remove. Runlspci -D -s 0001:01:00.0again: it prints nothing. If it still prints the line, stop.On the Pi, run
sudo openFPGALoader --cable rp1pio --pins 27:22:4:17 design.bitto load the bitstream through the RP1’s PIO peripheral.On the Pi, run
echo 1 | sudo tee /sys/bus/pci/rescanto bring the endpoint back. Ifls /sys/bus/platform/drivers/brcm-pcie/lists no1000110000.pcie, the host bridge removed itself at boot, with no link. Bind it again, with no unbind first:echo 1000110000.pcie | sudo tee /sys/bus/platform/drivers/brcm-pcie/bind. Give the link a few seconds before the Check. This bind waits for its run on a Pi 5 (test-designs issue #246).
The pin order is TDI:TDO:TCK:TMS. The FPGA enumerates only after a bitstream is loaded, and from then on step 1 lists a line and step 2 is mandatory.
Check¶
The load’s last line in step 3 ends with done 1. With done 0 the FPGA is not configured, whatever the exit status; the STAT register printed under it says why.
After step 4, lspci -D -s 0001:01:00.0 lists the NeTV2 as a Xilinx device, if the design has a PCIe endpoint. sudo lspci -vv -s 0001:01:00.0 | grep LnkSta shows Speed 5GT/s, Width x1, a Gen2 x1 link.
If it fails¶
What you see |
Likely cause |
Fix |
|---|---|---|
openFPGALoader does not know the |
The openFPGALoader build lacks it; the |
Install the package, or run the same command with |
The Pi crashes or drops off during the load |
The endpoint was still enumerated |
Detach it as in step 2, then load again |