- Quartus jtag server linux
- Setting up the Altera Quartus JTAG Programmer on Ubuntu 16.04
- Start the Quartus Programmer
- Unable to select the device in the Quartus programmer?
- Any further issues?
- Getting started with the Altera BeMicro SDK on Linux
- Install Altera tools
- USB-Blaster setup
- JTAG daemon configuration
- Check
- Run the tutorial
- See also
- libjtag для программирования Марсоход2RPI через сеть из Quartus под Ubuntu
Quartus jtag server linux
A subreddit for programmable hardware, including topics such as: * FPGA * CPLD * Verilog * VHDL
I have a main dev machine running Windows 10, that I develop my FPGA designs on in Intel Quartus Lite v19.1 (latest download from Intel).
I have a Terasic USB Blaster clone, and also a genuine Altera USB Blaster. I believe they should operate identically, but I have found the Terasic has trouble being recognised in Windows.
Having had trouble in the past with my USB Blaster dropping off the USB bus in Windows, I decided to try to use remote JTAG programming using a linux machine. I have installed both the free Quartus Programmer Lite v19.1 and also the Pro programmer v19.4 under Linux (Debian 10.x). Additionally, I have installed the full version of Quartus Lite under Windows. The debian machine is a real linux machine, not a VM (real USB port access).
Now, no matter what combination I try I cannot get the remote JTAG to work at all, in either direction.
Under Linux, I have the terasic USB Blaster connected to my JTAG chain, while under Windows I just have the genuine Altera USB Blaster connected to nothing. I have edited my udev rules to allow normal user access to the USB Blaster.
I have allowed access to the network for jtagserver using the Windows firewall configuration tool.
Here’s what I’ve tried, with the results:
- Just running quartus_pgmw does not allow me to change the local server config.
- Running jtagd directly from the commandline first will allow me to change the local server config using the quartus_pgmw GUI
- When jtagd has been run from the commandline, netstat tells me that it’s listening to 0.0.0.0 on port 1309. If I killall jtagd , it no longer is listening, so this tells me that the jtag server is the thing that’s actually listening on the port and not something else.
- When jtagd has been run from the command line, neither jtagconfig —enableremote foo nor configuring the quartus_pgmw gui to listen for remote connections changes the netstat output.
- When I try to connect to the IP of the linux machine using the windows machine programmer gui, I get an «unable to connect» error.
- When I try to connect to localhost (127.0.0.1) on the Linux machine using the GUI, it works
- When I try to connect to the linux machine’s external IP from itself, I get the same «unable to connect» error.
- When I enable the remote connections from the windows machine GUI, I get the same result: able to connect OK from 127.0.0.1, but unable to connect from the external IP address of the same machine.
- In either direction (Windows trying to connect to Linux remote server and Linux trying to connect to Windows remote server), «Unable to Connect».
In all cases, running jtagconfig —enum has the same error — unable to connect to the remote server.
Under Linux, if I try jtagconfig —enableremote foo , then jtagconfig —addserver (IP) foo , then enum the jtag bus I get «Unable to connect».
There must be something simple I’m missing in this; I’ve been trying for literally hours trying to get this to work!
TL;DR I can’t get remote JTAG debugging working using either the GUI or the command line, in either Windows or Linux, and would like to know what basic step I’m missing.
Setting up the Altera Quartus JTAG Programmer on Ubuntu 16.04
Before starting the JTAG programmer in Quartus, the dmesg entries should look like this:
[27810.071135] usb 1-1.2: new high-speed USB device number 18 using ehci-pci [27810.163900] usb 1-1.2: New USB device found, idVendor=09fb, idProduct=6810 [27810.163905] usb 1-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
Start the Quartus Programmer
Starting the programmer will do 2 things:
- Load the JTAG server ( jtagd —user-start —config ~/.jtagd.conf )
- Load the driver for the USB connection
[28122.900173] usb 1-1.2: new high-speed USB device number 25 using ehci-pci [28123.010811] usb 1-1.2: New USB device found, idVendor=09fb, idProduct=6010 [28123.010818] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [28123.010822] usb 1-1.2: Product: DE-SoC [28123.010825] usb 1-1.2: Manufacturer: Altera [28123.010828] usb 1-1.2: SerialNumber: DE-SoC-003-03503
Unable to select the device in the Quartus programmer?
The most likely issue is that currently, you do not have permission to access the device, as by default, USB devices are only accessible as root. Luckily, (as long as you have root access in your system), you can fix this.
- Figure out where the USB device lives on the filesystem. In UNIX, everything is a file, including USB devices. Go to /dev/bus/usb , where you will find several folders. The first level indicates the (internal) USB hub, the second level the device number. As seen before, my device has number 25, therefore there is only 1 candidate: /dev/bus/usb/001/025 .
- Set read-write permissions for all users on that file, eg sudo chmod 666 /dev/bus/usb/001/025 . This has to be done every time you plug in your FPGA, which can get very tedious.
- Luckily, the linux kernel devs have thought of this and added a feature called udev rules. These are commands that are run, as root, when a USB device of a specific signature connects. Create the file /etc/udev/rules.d/52-usbblaster.rules . Any number between 0 and 100 and name will do but usually the high and low 10 are reserved for system purposes. Do make sure it adheres to the format -.rules . In this file create one udev entry. Mine is shown below. Ensure that the idVendor and idProduct actually match the codes displayed in your dmesg output. The rest of the entry is self-explanatory. Finally, restart the udev service by sudo service udev restart , forcing it to reload the udev rules.
- Check whether your udev rules has worked. Replug your USB connection and verify that your device now has read and write permissions for all users, eg:
# The USB Blaster UDEV entry in /etc/udev/rules.d/52-usbblaster.rules SUBSYSTEM=="usb", ATTRidVendor>=="09fb", ATTRidProduct>=="6010", MODE="0666"
$ tree /dev/bus/usb . ├── 001 │ ├── 001 │ ├── 002 │ ├── 003 │ ├── 005 │ ├── 013 │ └── 025 ├── 002 │ ├── 001 │ └── 002 ├── 003 │ └── 001 └── 004 └── 001
# After successfully applying the udev rule or manually setting the permission ls -lh /dev/bus/usb/001 crw-rw-r-- 1 root root 189, 0 Mar 18 21:22 001 crw-rw-r-- 1 root root 189, 1 Mar 18 21:22 002 crw-rw-r-- 1 root root 189, 2 Mar 18 21:22 003 crw-rw-r-- 1 root root 189, 4 Mar 18 21:22 005 crw-rw-r-- 1 root root 189, 12 Mar 18 21:22 013 crw-rw-rw- 1 root root 189, 35 Mar 18 21:27 036 # all users have read/write permission
Any further issues?
I believe this should be a comprehensive guide for getting Altera FPGAs working on Ubuntu 16.04. If you still have issues, please leave a comment so we can resolve it and add it to the guide.
Getting started with the Altera BeMicro SDK on Linux
The article below discusses a 10-year old version of Quartus and how to configure JTAG on Linux versions before systemctl. Some references from the original article like the Altera Wiki are no longer available. Therefore the links have been cleaned up.
I recently got an FPGA-on-a-USB-stick as a Christmas present: an Altera/Arrow BeMicro SDK. Fun to play with and ideal to refresh my hardware design skills… I thought… Immediately I was confronted again with how much work it is to set up all necessary hardware design tools.
The system requirements states that you need Windows, but fortunately I got it working on Linux (Fedora release 13 (Goddard)). Installing Altera Quartus and Nios II went flawlessly. Finding out how to get JTAG with the USB blaster to work was a bit harder.
Install Altera tools
The Altera Quartus 10.1 installation was slow because of the huge 6GB download but it finished without issues; no special tricks that were required for earlier versions.
If your Linux machine has SE Linux enabled, run:
USB-Blaster setup
Setting the USB-blaster was a bit harder: As described on the Altera website, you need to create an extra udev rule ( sudo vim /etc/udev/rules.d/51-usbblaster.rules ) with following content:
You can load this new rule by running sudo udevadm control —reload-rules
JTAG daemon configuration
Based on the description on the Altera Wiki, I created two configuration files:
Next, I appended following lines to my to my /etc/rc.local file:
/proc/sys/kernel/sem And I started the jtagd daemon by running rc.local:
Check
You can easily verify that Everything is working with following procedure:
- Plug in your BeMicro SDK stick
- Start Quartus II
- Select Tools > Programmer
- Click the «Hardware Setup. » button, double click on «USB-Blaster» and click close
- If you now press the «Autodetect» button, two devices should be visible: EP3C25 and EP4CE22 (this is the Altera Cyclone 4 FPGA). If you see those it means that everything is OK.
Run the tutorial
See also
libjtag для программирования Марсоход2RPI через сеть из Quartus под Ubuntu
Теперь программирование нашей FPGA платы Марсоход2RPI, работающей в связке с платой Raspberry, по сети из Quartus стало возможным и из Ubuntu Linux!
Первое, скачать сервер для Raspberry:
Распаковать архив и файл nw_jtag_srv перенести на Raspberry. Здесь файл нужно сделать исполняемым. Для этого выполните команду
>sudo chmod a+x ./nw_jtag_srv
Плата Марсоход2RPI подключается через переходничек к GPIO портам платы Raspberry. Сервер nw_jtag_srv будет через GPIO пины программировать FPGA платы Марсоход2RPI. Для доступа к GPIO нужны повышенные права, поэтому запускать сервер нужно через sudo:
>sudo ./nw_jtag_srv
Теперь для Ubuntu нужен специальный драйвер для JTAG сервера. На самом деле это простая библиотека типа *.so. Ее можно скачать здесь:
>tar -xzf libjtag_hw_net-blaster_1_9b.tar.gz
и скопируйте файл библиотеки libjtag_hw_net-blaster.so в папку квартуса:
>cp libjtag_hw_net-blaster.so ~/intelFPGA_lite/19.1/quartus/linux64
САПР Quartus Prime будет запускать JTAG сервер, который найдет нашу библиотеку и будет ее использовать. Библиотека пользуясь широковещательными запросами UDP сама найдет в сети работающий на Raspberry сервер nw_jtag_srv и свяжется с ним.
В консоли в Ubuntu можно проверить статус программатора командой квартуса jtagconfig:
Ну и, конечно, можно прямо из квартуса удаленно по сети программировать FPGA Cyclone IV платы Марсоход2RPI, вот скриншот об успешности программирования:
PS: Моя Ubuntu работает в виртуальной машине, на реальной думаю все будет так же.