zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    leetcode 78 子集
    leetcode 404 左叶子之和
    《数学有意思》28杠杆原理 29信息革命 30可信的数学
    《数学有意思》25中心极限定理 26混沌现象 27焦虑
    《数学有意思》22算术和几何 23统计学 24概率
    《数学有意思》19数学语言 20函数 21无理数
    《数学有意思》16归纳法 17因果关系 18物理学
    《数学有意思》13度量的本质 14度量单位 15科学也是一种模型
    《数学有意思》10思维工具 11选择合适的数学模型 12几何学
    《数学有意思》07公理是“公认的道理”吗 08什么是好的公里系统 09数学模型
  • 原文地址:https://www.cnblogs.com/shengansong/p/1704176.html
Copyright © 2011-2022 走看看