Chinaunix首页 | 论坛 | 博客
  • 博客访问: 514620
  • 博文数量: 484
  • 博客积分: 10145
  • 博客等级: 上将
  • 技术积分: 5805
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-27 18:34
文章分类

全部博文(484)

文章存档

2011年(52)

2010年(107)

2009年(287)

2008年(38)

我的朋友

分类:

2011-07-07 13:54:19

http://www.cnblogs.com/shengansong/archive/2010/04/04/1704176.html

ubuntu下安装usbblaster(更新)

ubuntu 9.04:

Step 1: Set-up "usbfs" emulation (see Ubuntu bug #156085 for the history behind this, if you're curious)

1) Open /etc/init.d/mountdevsubfs.sh as root ("sudo gedit /etc/init.d/mountdevsubfs.sh" from a terminal)

2) Scroll down to the part that reads "domount devpts ..."

3) Add this after that line:

Code:

#

# Magic to make /proc/bus/usb work

#

mkdir -p /dev/bus/usb/.usbfs

domount usbfs "" /dev/bus/usb/.usbfs usbfs -obusmode=0700,devmode=0600,listmode=0644

ln -sf .usbfs/devices /dev/bus/usb/devices

mount --rbind /dev/bus/usb /proc/bus/usb

4) Save and close.

5) Run "sudo /etc/init.d/mountdevsubfs.sh start"

Step 2: Tell Ubuntu to let normal users use the USB blaster

1) Create a new file at /etc/udev/rules.d/51-usbblaster.rules ("sudo gedit /etc/udev/rules.d/51-usbblaster.rules")

2) Put this in it:

Code:

# Altera USB-Blaster rule to set mode to 666.

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", SYSFS{idVendor}=="09fb", SYSFS{idProduct}=="6001", MODE="0666", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", RUN+="/bin/chmod 0666 %c"

3) Save and close.

4) Run "sudo udevadm control --reload-rules".

It's now configured! Connect your USB blaster (or remove and reconnect if it's already in) and then launch Quartus. It should now be selectable in Tools -> Programmer -> Hardware Setup.

ubuntu 9.10(我用的就是9.10):

Updated instructions for Ubuntu 9.10 (Karmic Koala):

The file that I said to modify in Step 1 no longer exists in Karmic, so instead edit the file /etc/rc.local and add this at the bottom:

Code:

# USBFS emulation for Altera USB Blaster.

mkdir -p /dev/bus/usb/.usbfs

mount -n -t usbfs usbfs /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644

ln -sf .usbfs/devices /dev/bus/usb/devices

mount --rbind /dev/bus/usb /proc/bus/usb

Then save that file and run "sudo /etc/rc.local".

Also then do Step 2 in the same way as in the original instructions.

最通用的方法:
对于9.10以上版本,当内核大于2.31.17以后,就不可以使用usbfs,jtagd文件调用的是/proc/bus/usb
但是我们在/proc/bus下看不到usb文件夹,而在/dev/bus下却有usb文件夹,于是我们就用/dev/bus/usb来代替/proc/bus/usb

具体内容如下:
(1)edit the file /etc/rc.local(sudo gedit /etc/rc.local) and add this at the bottom:

Code:

# USBFS emulation for Altera USB Blaster.
ln -s /sys/kernel/debug/usb/devices /dev/bus/usb/devices

Then save that file and run "sudo /etc/rc.local".

(2)
1) Create a new file at /etc/udev/rules.d/51-usbblaster.rules ("sudo gedit /etc/udev/rules.d/51-usbblaster.rules")

2) Put this in it:

Code:

# Altera USB-Blaster rule to set mode to 666.

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", SYSFS{idVendor}=="09fb", SYSFS{idProduct}=="6001", MODE="0666", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", RUN+="/bin/chmod 0666 %c"

3) Save and close.

4) Run "sudo udevadm control --reload-rules".


(3)Then paste these blocks into a command prompt in two batches. Each one will bring up a scary-looking editor, after which you just press enter.

sudo vim /home/shengansong/SOFTWARE/Altera/quartus/linux/jtagd
:%s/\/proc\/bus\/usb\/%03u\/%03u/\/dev\/bus\/usb\/%03u\/%03u\n/
:%s/\/proc\/bus\/usb\/devices/\/dev\/bus\/usb\/devices\n/
:wq

sudo vim /home/shengansong/SOFTWARE/Altera/quartus/linux64/jtagd
:%s/\/proc\/bus\/usb\/%03u\/%03u/\/dev\/bus\/usb\/%03u\/%03u\n/
:%s/\/proc\/bus\/usb\/devices/\/dev\/bus\/usb\/devices\n/
:wq
阅读(586) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~