Mudanças entre as edições de "Configuração da USB para programação do FPGA via JTAG"

De MediaWiki do Campus São José
Ir para navegação Ir para pesquisar
(Criou página com '=UBUNTU= Para instalar o driver USB é necessário ser SUDOER ou SU. Neste processo será dada a permissão ao usuário atual para utilizar o USB. Crie um novo arquivo de reg...')
 
(29 revisões intermediárias por 3 usuários não estão sendo mostradas)
Linha 1: Linha 1:
=UBUNTU=
+
=UBUNTU =
 +
Antes de poder programar um FPGA usando a interface JTAG é necessário Configurar a USB Blaster para a programação JTAG.
 +
 
 +
O procedimento abaixo é usado nos kits:
 +
*DE2-115, DE0-Nano, DE0 da Altera
 +
*Mercurio IV da Macnica
 +
<!--
 +
Executar como '''root''' os seguintes comandos para criar o arquivo '''51-usbblaster.rules''' na pasta '''/etc/udev/rules.d'''
 +
cd /etc/udev/rules.d
 +
gedit 51-usbblaster.rules
 +
# Altera USB-Blaster rule to set mode to 666.
 +
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device",
 +
ATTR{idVendor}=="09fb", ATTR{idProduct}=="6001", MODE="0666", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", RUN+="/bin/chmod 0666 %c"
 +
-->
 +
Executar como '''root''' os seguintes comandos para criar o arquivo '''altera-usb-blaster.rules''' na pasta '''/etc/udev/rules.d'''
 +
gedit /etc/udev/rules.d/altera-usb-blaster.rules
 +
 
 +
Com o conteúdo:
 +
ATTR{idVendor}=="09fb", ATTR{idProduct}=="6001", MODE="666"
 +
ATTR{idVendor}=="09fb", ATTR{idProduct}=="6002", MODE="666"
 +
ATTR{idVendor}=="09fb", ATTR{idProduct}=="6003", MODE="666"
 +
ATTR{idVendor}=="09fb", ATTR{idProduct}=="6010", MODE="666"
 +
ATTR{idVendor}=="09fb", ATTR{idProduct}=="6810", MODE="666"
 +
 
 +
'''Reinicie o computador.'''
 +
 
 +
Para verificar se a JTAG está configurada corretamente, conecte a placa usando a USB e  ligue-a. 
 +
 
 +
cd /opt/altera/13.0sp1/quartus/bin
 +
./jtagconfig
 +
 
 +
Se estiver OK, deve aparece alguma mensagem do tipo:
 +
 
 +
1) USB-Blaster [3-3]
 +
 
 +
Se permanecer a mensagem abaixo, desligue o kit, ou retire o cabo USB, e reconecte ou ligue novamente o kit.
 +
1) USB-Blaster variant [3-3]
 +
  Unable to lock chain (Insufficient port permissions)
 +
 
 +
Caso não esteja OK, aparecerá:
 +
 
 +
No JTAG hardware available
 +
 
 +
FONTE: http://www.altera.com/download/drivers/dri-usb_b-lnx.html
 +
FONTE: http://www.eecg.toronto.edu/~laforest/USB-Blaster-Debian.html
 +
 
 +
<!--
 +
=UBUNTU para DE0 Nano==
 +
 
 +
 
 +
USB Blaster Configuration for JTAG Programming on Ubuntu
 +
 +
 
 +
I just finished setting up Altera Quartus 11 for use with my new DE0-Nano FPGA Education board on Ubuntu 11.04. I had a little trouble getting the USB Blaster interface configured, so I thought I’d post the solution here for future reference.
 +
 
 +
Ubuntu uses ‘udev’ to manage devices connected to the system. By default, when udev detects the board is connected to the system, it mounts it as a USB device w/ root:root ownership and 0660 permissions (-rw-rw----)... Since when you run Quartus it launches ‘jtagd’ as your local user, who does not have permissions to write to the USB device, you’re unable to program your FPGA board.
 +
 
 +
To confirm this is your problem, simple execute the following two commands:
 +
 
 +
    killall jtagd
 +
    sudo /opt/altera/11/quartus/bin/jtagd
 +
 
 +
(Note: I installed Altera Quartus 11 to /opt/altera/11/ -- update the path accordingly for your system.).
 +
 
 +
After you do this, disconnect and reconnect your development board, then try the programmer again twice. The first time you’ll get a message saying it couldn’t find the hardware, the second time is should succeed.
 +
 
 +
Assuming it succeeds, you can update the system settings so that you have access to write to the USB device, so it doesn’t matter that jtagd is running under your local user:
 +
 
 +
1)Create a new group called “usbblaster”: sudo groupadd usbblaster
 +
 
 +
2)Add yourself to that new group: sudo usermod -a -G usbblaster username
 +
 
 +
3)Create a new udev rule to mount the interface with root:usbblaster ownership:
 +
 
 +
a)Create a new file: /etc/udev/rules.d/40-altera-usbblaster.rules
 +
 
 +
b)Paste the following line into it (as a single line):
 +
 
 +
BUS=="usb", SYSFS{idVendor}=="09fb", SYSFS{idProduct}=="6001", MODE="0666", SYMLINK+="usbblaster", GROUP="usbblaster"
 +
 
 +
c)Reboot, and enjoy!
 +
 
 +
=UBUNTU para kit DSP com inteface antiga=
 
Para instalar o driver USB é necessário ser SUDOER ou SU.   
 
Para instalar o driver USB é necessário ser SUDOER ou SU.   
 +
Se tiver instalado uma lousa interativa da SMART Technologia é necessario primeiro corrigir o PATH, pois o nome do diretorio de instalação está com espaços.  Verifique se vai dar problema com:
 +
export | grep -i smart
 +
 +
Se aparecer no PATH os seguintes caminhos, vai ser necessário corrigir primeiro.
 +
/opt/SMART Technologies/SMART Product Drivers/bin:
 +
/opt/SMART Technologies/Notebook Software/bin:
 +
 +
Troque os caminhos para:
 +
/opt/SMART\ Technologies/SMART\ Product\ Drivers/bin:
 +
/opt/SMART\ Technologies/Notebook\ Software/bin:
 +
Depois disso você poderá configurar a jtag.
  
 
Neste processo será dada a permissão ao usuário atual para utilizar o USB.  
 
Neste processo será dada a permissão ao usuário atual para utilizar o USB.  
Linha 25: Linha 118:
  
 
Agora os seguintes comandos devem ser executados dependendo do ubuntu que se está usando. Não esqueça de substituir <pasta_de_instalação>  pelo local em que o quartus está instalado.
 
Agora os seguintes comandos devem ser executados dependendo do ubuntu que se está usando. Não esqueça de substituir <pasta_de_instalação>  pelo local em que o quartus está instalado.
 +
 +
export QUARTUS=/opt/altera/quartus
  
 
Para ubuntu 32bits:
 
Para ubuntu 32bits:
  sudo sed -i.bak 's/\/proc\/bus\/usb\/%03u\/%03u/\/dev\/bus\/usb\/%03u\/%03u\d0/g' /altera/quartus/linux/jtagd
+
  export VER=linux
sudo sed -i 's/\/proc\/bus\/usb\/devices/\/dev\/bus\/usb\/devices\d0/g' /altera/quartus/linux/jtagd
 
  
 
Para ubuntu 64bits:
 
Para ubuntu 64bits:
  sudo sed -i.bak 's/\/proc\/bus\/usb\/%03u\/%03u/\/dev\/bus\/usb\/%03u\/%03u\d0/g' /altera/quartus/linux64/jtagd
+
export VER=linux64
  sudo sed -i 's/\/proc\/bus\/usb\/devices/\/dev\/bus\/usb\/devices\d0/g' /altera/quartus/linux64/jtagd
+
 
 +
Em seguida
 +
  sudo sed -i.bak 's/\/proc\/bus\/usb\/%03u\/%03u/\/dev\/bus\/usb\/%03u\/%03u\d0/g' $QUARTUS/$VER/jtagd
 +
  sudo sed -i 's/\/proc\/bus\/usb\/devices/\/dev\/bus\/usb\/devices\d0/g' $QUARTUS/$VER/jtagd
  
 
Agora, se você executar:
 
Agora, se você executar:
  /altera/quartus/bin/jtagconfig
+
  $QUARTUS/bin/jtagconfig
  
 
Se aparecer a mensagem USB-Blaster [USB X-X.X]  
 
Se aparecer a mensagem USB-Blaster [USB X-X.X]  
jtagd: 59: ARGV[0]=--user-start: not found
+
 
jtagd: 59: ++val: not found
+
  1) USB-Blaster [4-1]
jtagd: 59: ARGV[0]=--config: not found
+
  120930DD   EP2S60
jtagd: 59: ++val: not found
+
 
jtagd: 59: ARGV[0]=/home/user/.jtagd.conf: not found
+
NOTA:  OK testado com: Quartus II version11.0 Build 208, SP1
jtagd: 59: ++val: not found
 
  1) USB-Blaster [USB 1-1.1]
 
  020B30DD   EP2C15/20
 
  
 
Então você configurou corretamente e o programador do quartus precisa ser configurado para:
 
Então você configurou corretamente e o programador do quartus precisa ser configurado para:
+
-->
  
 
=WINDOWS=
 
=WINDOWS=
 
Quando alguém precisar, escrever o procedimento.
 
Quando alguém precisar, escrever o procedimento.
 +
 +
==Installing Altera usb Blaster Driver==
 +
*Plug in the power and turn on your development board
 +
*Plug in your Development board or USB Blaster device into a free USB port
 +
*In Windows 7, 8, 8.1, and 10 go to Start and search for “device manager”
 +
*Click on Device manager in the search results
 +
:*In device manager find the item list “other devices”
 +
:*Expand that list and there should be “Altera USB-Blaster”
 +
:*Right click on Altera USB-Blaster
 +
:*Choose Update Driver Software...
 +
:*In the popup choose “Browse my computer for driver software”
 +
:*Click Browse and navigate to the altera folder C:\altera
 +
:*Make sure the “Include Subfolders” is checked
 +
:*Click next
 +
*If successful windows will say “Windows has successfully updated your driver software” Click close
 +
*Back in device manager under Universal Serial Bus Controllers there should be the Altera USB-Blaster
 +
*Close out of Device manager and you are now ready to program your Development board.
 +
 +
:Note: On the DE2-115 there are two USB ports but the one closet to the edge is the USB blaster
 +
:Note: It is best to NOT use USB ports that have active power or an “always on” feature as these ports can damage your development board or USB blaster chip
 +
 +
FONTE: http://fpga.seanwrall.com/lessons/lesson4/ e [http://fpga.seanwrall.com/lessons/lesson4/downloads/Lesson4_FPGASeanWRall.pdf pdf], [https://www.youtube.com/watch?v=glk73wRVQ-c video]
 +
 +
VER: [http://www.altera.com/download/drivers/usb-blaster/dri-usb-blaster-vista.html USB-Blaster Driver for Windows 7 and Windows Vista]
 +
 +
[[Categoria:FPGA]]

Edição das 14h33min de 22 de setembro de 2020

UBUNTU

Antes de poder programar um FPGA usando a interface JTAG é necessário Configurar a USB Blaster para a programação JTAG.

O procedimento abaixo é usado nos kits:

  • DE2-115, DE0-Nano, DE0 da Altera
  • Mercurio IV da Macnica

Executar como root os seguintes comandos para criar o arquivo altera-usb-blaster.rules na pasta /etc/udev/rules.d

gedit /etc/udev/rules.d/altera-usb-blaster.rules 

Com o conteúdo:

ATTR{idVendor}=="09fb", ATTR{idProduct}=="6001", MODE="666"
ATTR{idVendor}=="09fb", ATTR{idProduct}=="6002", MODE="666"
ATTR{idVendor}=="09fb", ATTR{idProduct}=="6003", MODE="666"
ATTR{idVendor}=="09fb", ATTR{idProduct}=="6010", MODE="666"
ATTR{idVendor}=="09fb", ATTR{idProduct}=="6810", MODE="666"

Reinicie o computador.

Para verificar se a JTAG está configurada corretamente, conecte a placa usando a USB e ligue-a.

cd /opt/altera/13.0sp1/quartus/bin
./jtagconfig

Se estiver OK, deve aparece alguma mensagem do tipo:

1) USB-Blaster [3-3]

Se permanecer a mensagem abaixo, desligue o kit, ou retire o cabo USB, e reconecte ou ligue novamente o kit.

1) USB-Blaster variant [3-3]
 Unable to lock chain (Insufficient port permissions)

Caso não esteja OK, aparecerá:

No JTAG hardware available

FONTE: http://www.altera.com/download/drivers/dri-usb_b-lnx.html FONTE: http://www.eecg.toronto.edu/~laforest/USB-Blaster-Debian.html


WINDOWS

Quando alguém precisar, escrever o procedimento.

Installing Altera usb Blaster Driver

  • Plug in the power and turn on your development board
  • Plug in your Development board or USB Blaster device into a free USB port
  • In Windows 7, 8, 8.1, and 10 go to Start and search for “device manager”
  • Click on Device manager in the search results
  • In device manager find the item list “other devices”
  • Expand that list and there should be “Altera USB-Blaster”
  • Right click on Altera USB-Blaster
  • Choose Update Driver Software...
  • In the popup choose “Browse my computer for driver software”
  • Click Browse and navigate to the altera folder C:\altera
  • Make sure the “Include Subfolders” is checked
  • Click next
  • If successful windows will say “Windows has successfully updated your driver software” Click close
  • Back in device manager under Universal Serial Bus Controllers there should be the Altera USB-Blaster
  • Close out of Device manager and you are now ready to program your Development board.
Note: On the DE2-115 there are two USB ports but the one closet to the edge is the USB blaster
Note: It is best to NOT use USB ports that have active power or an “always on” feature as these ports can damage your development board or USB blaster chip

FONTE: http://fpga.seanwrall.com/lessons/lesson4/ e pdf, video

VER: USB-Blaster Driver for Windows 7 and Windows Vista