Results 1 to 6 of 6

Thread: How does USB work | Xilinx Spartan 3E driver problem

  1. #1
    Join Date
    Jul 2007
    Beans
    6

    Question How does USB work | Xilinx Spartan 3E driver problem

    Hi.

    I have a Xilinx Spartan 3E development board, which connects to my laptop through USB. On Ubuntu 9.04 I somehow managed to make the whole thing work, but I am having problems with 9.10.

    Now I managed to do things by hand, but since I don't know what exactly happens when a USB device is plugged in, I cannot make things automatic. To the point.

    After driver installation, a xusbdfwu.rules file is created in /etc/udev/rules.d with the following content:
    Code:
    # version 0003
    SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="0008", MODE="666"
    BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="0007", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusbdfwu.hex -D $TEMPNODE"
    BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="0009", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xup.hex -D $TEMPNODE"
    BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="000d", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_emb.hex -D $TEMPNODE"
    BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="000f", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xlp.hex -D $TEMPNODE"
    BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="0013", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xp2.hex -D $TEMPNODE"
    BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="0015", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xse.hex -D $TEMPNODE"
    (BTW: I tried renaming the file to 50-xusbdfwu.rules (not sure why), but that didn't change anything.)

    I did install fxload, but when I plug the device, nothing happens. Here's what dmesg | tail gives me:
    Code:
    [ 4463.472139] usb 2-1: new high speed USB device using ehci_hcd and address 15
    [ 4463.609074] usb 2-1: configuration #1 chosen from 1 choice
    Now using lsusb, I found my device:
    Code:
    armandas@ouroboros:~$ lsusb 
    Bus 006 Device 003: ID 046d:c050 Logitech, Inc. RX 250 Optical Mouse
    Bus 002 Device 015: ID 03fd:000d Xilinx, Inc. 
    Bus 002 Device 006: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E270 HSDPA/HSUPA Modem
    So I tried running the command from rules file:
    Code:
    armandas@ouroboros:~$ sudo /sbin/fxload -v -t fx2 -I /usr/share/xusb_emb.hex -D /dev/bus/usb/002/015 
    microcontroller type: fx2
    single stage:  load on-chip memory
    open RAM hexfile image /usr/share/xusb_emb.hex
    stop CPU
    write on-chip, addr 0x1d3d len   10 (0x000a)
    ...
    write on-chip, addr 0x0bfd len   79 (0x004f)
    ... WROTE: 7458 bytes, 85 segments, avg 87
    reset CPU
    And amazingly, it worked! The LED on the board lit up. Note however, that I had to run this as root, so some permission settings are missing as well.

    Could anyone please advice me on how to make this work on its own? I could write a script to do just that, but there must be a proper solution.

  2. #2
    Join Date
    Jul 2007
    Beans
    6

    Re: How does USB work | Xilinx Spartan 3E driver problem

    I read udev manual and tried to play around with the rules file, but I don't seem to be able to make it work. I checked device properties using
    Code:
    udevadm info --attribute-walk --name=/dev/bus/usb/002/015
    and copied some parameters to rules file:
    Code:
    SUBSYSTEM=="usb", ATTR{idVendor}=="03fd", ATTR{idProduct}=="000d", MODE="666", RUN+="touch /home/armandas/Desktop/it_worked.txt"
    I tried both restarting udev and --reload-rules to make sure changes are detected.

    I also tried leaving only SUBSYSTEM=="usb" to make it generic, but that didn't help either. What am I missing?

  3. #3
    Join Date
    Nov 2009
    Beans
    3

    Re: How does USB work | Xilinx Spartan 3E driver problem

    Hi,
    I had the same problem. Seems to work now and all I've done was changing $TEMPNODE to lowercase:
    Code:
    SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="0008", MODE="666"
    BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="0007", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusbdfwu.hex -D $tempnode"
    BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="0009", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xup.hex -D $tempnode"
    BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="000d", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_emb.hex -D $tempnode"
    BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="000f", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xlp.hex -D $tempnode"
    BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="0013", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xp2.hex -D $tempnode"
    BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="0015", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xse.hex -D $tempnode"

  4. #4
    Join Date
    Jul 2007
    Beans
    6

    Re: How does USB work | Xilinx Spartan 3E driver problem

    That did actually help, I just had to delete the BUS=="usb" part. Thanks for the tip!

  5. #5
    Join Date
    Dec 2009
    Beans
    3

    Re: How does USB work | Xilinx Spartan 3E driver problem

    Excellent, same problem here, and fix worked! I filed a bug #492018 for this, as Udev seems to have required this unexpected change. Maybe this will help others as well.

    Cheers, Ole

    Quote Originally Posted by rndhro View Post
    Hi,
    I had the same problem. Seems to work now and all I've done was changing $TEMPNODE to lowercase:
    Code:
    SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="0008", MODE="666"
    BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="0007", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusbdfwu.hex -D $tempnode"
    BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="0009", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xup.hex -D $tempnode"
    BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="000d", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_emb.hex -D $tempnode"
    BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="000f", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xlp.hex -D $tempnode"
    BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="0013", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xp2.hex -D $tempnode"
    BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="0015", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusb_xse.hex -D $tempnode"
    Last edited by noleti; December 3rd, 2009 at 07:33 PM.

  6. #6
    Join Date
    Dec 2009
    Beans
    3

    Re: How does USB work | Xilinx Spartan 3E driver problem

    Got feedback on the Bug

    Quote Originally Posted by Scott James Remnant
    /etc/udev/rules.d/xusbdfwu.rules is listed as a custom rule file you have created, and as given in the Forums it is quite simply wrong.

    Without knowing more, it should probably look more like:
    SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="03fd", ATTR{idProduct}=="0007", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/xusbdfwu.hex -D %N"




Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •