Firstly, please connect your board to your computer with a network cable. Even though most of modern ethernet cards supports direct connection between each other, if you're not sure about whether you need a crossover cable, you can hook your computer and the dev board to an inexpensive switch like the following picture - -
After the hooking up, you need to configure the network to match Litex bootloader's expectation :
# If you're using 'user-friendly' Linux distros, e.g. Ubuntu, Fedora ......
# it's better to disable NetworkManager to mitigate interferenece.
sudo systemctl stop NetworkManager
# Change the NIC dev name to match your platform
sudo ip link set dev enp0s20u2u4 down
sudo ip addr add dev enp0s20u2u4 192.168.1.100/24
sudo ip link set dev enp0s20u2u4 up
The ip address above could be configured via modifying source code.
Then you need to setup tftp server. If you prefer a quick and oneshot only solution, tftpy is simple enough.
#!/usr/bin/python
import tftpy
server = tftpy.TftpServer('/tmp/tftpboot')
server.listen('0.0.0.0', 69)
You need to put
emulator.bin
: the M-mode firmware that implements SBIImage
: Linux kernelrootfs.cpio
: rootfs imagerv32.dtb
: compiled device tree into/tmp/tftpboot
which the python script configured above.
Then, we can fire up a command which loads bitstream to the dev board and launch a console :
openocd -f /usr/share/trellis/misc/openocd/ecp5-versa5g.cfg -c "transport select jtag; init; svf build/versa_ecp5/gateware/top.svf; exit" && \
lxterm --speed=1e6 /dev/ttyUSB1
You should be able to see that LiteX bootloader requested its needed file and boots now. Here's a recored footage booting an Alpine Linux :-) https://asciinema.org/a/332286