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

  • 相关阅读:
    c#的运算符
    modbus-poll和modbus-slave工具的学习使用——modbus协议功能码1的解析
    modbus-poll和modbus-slave工具的学习使用——环境搭建
    STM32L4R9使用HAL库调试IIC注意事项
    蓝牙透传——介绍蓝牙最简单、最常见的通讯方式
    Chapter 2 Open Book——11
    Chapter 2 Open Book——10
    Chapter 2 Open Book——9
    线程中sleep方法和wait方法有什么区别?
    你所不知道的mybatis居然也有拦截器
  • 原文地址:https://www.cnblogs.com/shengansong/p/1704176.html
Copyright © 2011-2022 走看看