Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

USB-blaster on Scientific Linux 5.4

Hello,

I'm having trouble getting the USB-blaster on Scientific Linux 5.4 working for the normal user. I know that it works when I run as root, so I must be setting something up incorrectly. I followed the instructions from Altera USB user guide (ug_usb_blstr.pdf) for Red hat enterprise 5.

From 52-usbblaster.rules:


#  USB-Blaster
BUS=="usb", SYSFS{idVendor}=="09fb", SYSFS{idProduct}=="6001", MODE="0666", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf /proc/bus/usb/%%03i/%%03i$${K%
%%%.*} $${K#*.}'", RUN+="/bin/chmod 0666 %c"

I've seen other posts on this forum for similar issues and have tried some of them without any luck.

Has anyone gotten this to work? Is there anything I need to do other than just creating the rules file?

Please advise, thanks in advance,

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    If it works as root but not as a normal user then you have a permissions problem. When you plug in the USB-Blaster two new character files will appear with the following names:

    • /dev/bus/usb/<busnum>/<devnum> (used by ACDS 11.0 on newer kernels)

    • /proc/bus/usb/<busnum>/<devnum> (used by ACDS 10.1 and older)

    If you have your udev rules right (or hotplug rules for older versions of Linux) then these devices should be readable and writable by all users.

    If the devices aren't accessible by normal users then that is your problem.

    ps. Please post OS and kernel version in future replies if you still can't get this to work.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I ended up using the following rules and wrote a simple script to handle the strings correctly. Here are the rules:

    /etc/udev/rules.d/52-usbblaster.rules (all on one line):

    
    #  USB-Blaster
    BUS=="usb", SYSFS{idVendor}=="09fb", SYSFS{idProduct}=="6001", MODE="0666",PROGRAM="/etc/udev/scripts/altera_usb_blaster.sh %k",
    RUN+="/bin/chmod 0666 %c"
    

    /etc/udev/scripts/altera_usb_blaster.sh

    
    # !/bin/bash
    # 
    #  Assign passed parameter containing to local variant
    a=$1
    #  Strip out unneeded strings and convert 
    a=${a//usbdev};a=${a//_ep*};a=${a//./' '};
    #  Output format of USB blaster location 
    printf /proc/bus/usb/%03i/%03i $a
    

    If anyone has a better solution, please advise.

    --- Quote Start ---

    ps. Please post OS and kernel version in future replies if you still can't get this to work.

    --- Quote End ---

    The kernel version is "Linux version 2.6.18-238.5.1.el5." The OS is as identified in the title, scientific linux 5.4.