1 # FPGA/Board Boot-Loaders-Programmers
5 Installation instructions for dfu-util, openFPGALoader, ujprog, fujprog, xc3sprog and ecpprog for boards ULX3S, ECP5 and OrangeCrab.
7 Use of the automated install scripts recommended
9 * Source code: <https://git.code.sf.net/p/dfu-util/dfu-util>
10 * Source code: <https://github.com/trabucayre/openFPGALoader.git>
11 * Source code: <https://github.com/f32c/tools.git>
12 * Source code: <https://github.com/kost/fujprog.git>
13 * Source code: <https://github.com/xtrx-sdr/xc3sprog/>
14 * Source code: <https://github.com/gregdavill/ecpprog/>
15 * Bugzilla page <https://bugs.libre-soc.org/show_bug.cgi?id=791>
17 # Setting up new debootstrap and chroot into it
19 Run the following if you wish to isolate the nextpnr-xilinx build
20 from other software (reproducible builds) or use the schroot
21 auto-preparation script here:
22 <https://git.libre-soc.org/?p=dev-env-setup.git;a=blob;f=mk-deb-chroot;hb=HEAD>
24 export MY_CHROOT=/stable-chroot
26 debootstrap buster $MY_CHROOT http://deb.debian.org/debian/
27 mount -t proc proc $MY_CHROOT/proc
28 mount -t sysfs sysfs $MY_CHROOT/sys
29 mount -t devpts devpts $MY_CHROOT/dev/pts/
30 chroot $MY_CHROOT /bin/bash
32 # Download neccessary softwares
34 apt-get install -y libcurl3-gnutls/buster git/buster
36 git clone https://git.code.sf.net/p/dfu-util/dfu-util
37 git clone https://github.com/trabucayre/openFPGALoader.git
38 git clone https://github.com/f32c/tools.git
39 git clone https://github.com/kost/fujprog.git
40 git clone https://github.com/xtrx-sdr/xc3sprog.git
41 git clone https://github.com/gregdavill/ecpprog.git
43 # Steps to compile dfu-util
45 ## Necessary software to install
47 apt-get install -y build-essential make autoconf libusb-dev \
48 libusb-1.0-0-dev pkg-config
55 ./configure --prefix=/usr/local/fpga-boot-load-prog
60 # Steps to compile openFPGALoader
62 ## Necessary software to install
64 apt-get install -y cmake libftdi1-2 libftdi1-dev libhidapi-hidraw0 \
65 libhidapi-dev libudev-dev zlib1g-dev
67 ## Build openFPGALoader
72 cmake -DCMAKE_INSTALL_PREFIX=/usr/local/fpga-boot-load-prog ..
76 cp 99-openfpgaloader.rules /etc/udev/rules.d
79 # Steps to compile ujprog
84 git checkout 0698352b0e912caa9b8371b8f692e19aac547a69
86 cp Makefile.linux Makefile
87 sed -i -e 's@ -static@@g' \
88 -e 's@/usr/lib/${ARCHNAME}/libftdi.a@$(shell pkg-config --cflags --libs libftdi1)@g' \
89 -e 's@^USBLIB@#USBLIB@' Makefile
90 sed -i -e 's@usb_reset@ftdi_usb_reset@g' ujprog.c
92 install -m 4755 ujprog /usr/local/fpga-boot-load-prog/bin
94 cat > /etc/udev/rules.d/80-fpga-ulx3s.rules << EOF
95 # this is for usb-serial tty device
96 SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015", \
97 MODE="664", GROUP="dialout"
98 # this is for ujprog libusb access
99 ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015", \
100 GROUP="dialout", MODE="666"
104 # Steps to compile fujprog
110 mkdir build; cd build
111 cmake -DCMAKE_INSTALL_PREFIX=/usr/local/fpga-boot-load-prog ..
116 # Steps to compile xc3sprog
121 git checkout 99e7de20aa8323712e5f70ff74d2079d5fb45bc7
122 mkdir build; cd build
123 cmake -DCMAKE_INSTALL_PREFIX=/usr/local/fpga-boot-load-prog \
124 -DLIBFTDI_FOUND=YES -DLIBFTDI_INCLUDE_DIR="/usr/include/libftdi1" \
125 -DLIBFTDI_LIBRARIES="ftdi1" -DLIBUSB_FOUND=YES \
126 -DLIBUSB_INCLUDE_DIR="/usr/include" -DLIBUSB_LIBRARIES="usb" \
127 -DUSE_FTD2XX=OFF -DUSE_LIBUSB3380=OFF ..
132 # Steps to compile ecpprog
137 git checkout 7212b56a9d2fc6de534e06636a1c6d8b0c6f80ab
139 make PREFIX=/usr/local/fpga-boot-load-prog
140 make PREFIX=/usr/local/fpga-boot-load-prog install
143 # Install udev rules for boards
145 cat > /etc/udev/rules.d/90-ecp5.rules << EOF
146 SUBSYSTEM=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6020", \
147 GROUP="users", MODE="0666"
150 cat > /etc/udev/rules.d/90-ftdi-orangecrab.rules << EOF
151 SUBSYSTEM=="usb", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="5af0", \
152 GROUP="users", MODE="0666"
155 cat > /etc/udev/rules.d/90-arty7-100t.rules << EOF
156 SUBSYSTEM=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", \
157 GROUP="users", MODE="0666"
160 * Run finally this to update udev
161 * udevadm control --reload-rules && udevadm trigger
162 * usermod -a $USER -G plugdev