Forum Discussion

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

USB-Blaster 2.6 kernel problem

Hi ,

I have a problem with USB-BLASTER cable.

I work with SUSE 10.2 linux 2.6 kernel for the education environement.

ByteBlaster work OK, but USBBlaster on my DE2 board d'not work.

udev has added device usbblaster in /dev (/dev/usbblaster)

lsusb say:

Bus 002 Device 008: ID 09fb:6001 Altera

Bus 002 Device 001: ID 0000:0000

Bus 001 Device 002: ID 0471:0308 Philips PCVC680K WebCam [pwc]

Bus 001 Device 001: ID 0000:0000

I have these messages when I run jtagconfig command :

1) ByteBlaster [/dev/parport0]

Unable to lock chain (Hardware not attached)

when try to run commands:

jtagconfig --add USB-Blaster /dev/usbblaster

message is: Unable to add hardware (Unknown hardware)

jtagconfig --add USB_Blaster /dev/usbblaster

message is: Unable to add hardware (Unknown hardware)

jtagconfig --add USBBlaster /dev/usbblaster

message is: Unable to add hardware (Unknown hardware)

in /etc/udev/rules.d/50-udev-default.rules file i have configuration

BUS=="USB", SYSFS{idVendor}=="09fb", SYSFS{idProduct}=="6001", MODE="0666", NAME="usbblaster"

BUS=="USB", SYSFS{idVendor}=="09fb", SYSFS{idProduct}=="6002", MODE="0666", NAME="usbblaster"

BUS=="USB", SYSFS{idVendor}=="09fb", SYSFS{idProduct}=="6003", MODE="0666", NAME="usbblaster"

Board is connected as shown on lsusb, on hotplug system (SUSE 10.0) everything is OK, but on new SUSE 10.2 hotplug replaced by new udev system.

Where is the problem, does anybody know what is happening here??

4 Replies

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

    I had similar problem on Fedora core 6, which use udev too.

    $ jtagconfig
    1) USB_Blaster 
      Unable to lock chain (Insufficient port permissions)

    I changed the mode to "0666" but still have the same error.

    ACTION=="add", SUBSYSTEM=="usb_device", 
            PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", 
            NAME="%c", MODE="0644"

    Strangely, after some tries it worked once or twice, but failed later. I think jtagd did not get correct device. And jtagconfig can not handle the "add".
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    hi hippo

    your problem is "Insufficient port permissions"

    your USB-Blaster is recognized OK, only need to change permission on creation

    try to change to 0777 it is risky but may help you to resolv the problem.

    please write me how you configure you USB-Blaster from begin to end and step by step

    it may help me to resolve my problem.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Actually, FC6 might detect jtag without changing udev rules. The jtag got detected sometime with root account. I have to disable SELinux to run nios2-configure-sof. I tried changing the mode to 0666 in 50-udev.rules to get user access. Sometime it works, but mostly fails.

    There is no /etc/hotplug dir in FC6. The /etc/udev rules changed a lot from RHEL4. In FC6, the udev add the jtag as /dev/bus/usb/004/002 dev, the bus number may be different for different usb ports. I think you should not name the dev as "usbblaster".
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by hippo@Dec 27 2006, 09:00 PM

    actually, fc6 might detect jtag without changing udev rules. the jtag got detected sometime with root account. i have to disable selinux to run nios2-configure-sof. i tried changing the mode to 0666 in 50-udev.rules to get user access. sometime it works, but mostly fails.

    there is no /etc/hotplug dir in fc6. the /etc/udev rules changed a lot from rhel4. in fc6, the udev add the jtag as /dev/bus/usb/004/002 dev, the bus number may be different for different usb ports. i think you should not name the dev as "usbblaster".

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=20249)

    --- quote end ---

    --- Quote End ---

    It seems i ran into most of the problems above with my FC6 install, but i believe i discovered a solution to the flakyness of jtagconfig runnning as a user and getting invalid port permissions.

    I am still not sure of the cause, but running the JTAGD as a service (IE: as root without the typical --user-launch option (i think the name is wrong) that is used when running jtagconfig directly without jtagd running) resolves the issue. I can now consistently use the usbblaster in my fresh FC6 install.

    first, change the udev rules to allow users access to the usbblaster

    I created a new udev rule in /etc/udev/rules.d called usbblaster.rules

    BUS=="usb", SYSFS{product}=="USB-Blaster", SYMLINK+="usbblaster", MODE="0666"

    **NB this rule does not handle plugging in multiple USB Blasters, i didn&#39;t care as i only use one.. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif

    next, i created and initscript for jtagd :

    # !/bin/bash# # Init file for Altera JTAGD# # chkconfig: 2345 60 25# description: JTAG daemon# # processname: jtagd# config: /etc/jtagd

    # source function library

    . /etc/rc.d/init.d/functions

    RETVAL=0

    prog="jtagd"

    PID_FILE=/var/run/jtagd.pid

    JTAGD=/opt/altera6.1/quartus/bin/jtagd

    start()

    {

    echo -n $"Starting $prog: "

    $JTAGD && success || failure

    RETVAL=$?

    pidofproc $prog >> $PID_FILE

    echo

    }

    stop()

    {

    echo -n $"Stopping $prog: "

    if [ -n "`pidfileofproc $JTAGD`" ] ; then

    killproc $JTAGD

    else

    failure $"Stopping $prog"

    fi

    echo

    }

    case "$1" in

    start)

    start

    ;;

    stop)

    stop

    ;;

    restart)

    stop

    start

    ;;

    *)

    echo $"Usage: $0 {start|stop|restart}"

    RETVAL=1

    esac

    exit $RETVAL

    set the permissions, add it to all the runlevels (chkconfig --add jtagd)

    don&#39;t forget to change the path to the JTAGD to match your install path.

    The next step is to create the /etc/jtagd and put the pgm_parts stuff in it so all the parts would be recognized correctly.

    # mkdir /etc/jtagd # cp /opt/altera6.1/quartus/linux/pgm_parts.txt /etc/jtagd

    and then there seemed to be some confusion as to what this file should be named, so i shotgunned it and used them all

    # ln -s /etc/pgm_parts.txt /etc/jtagd/pgm_parts# ln -s /etc/pgm_parts.txt /etc/jtagd/jtagd.pgm_parts

    start the service as root# /etc/init.d/jtagd start

    and TADA!! everything magically works.

    --dalon