linux and USB JTAG at Spartan 3e starter

Started by Olaf June 9, 2007
Hi,

I have here my brand new Spartan 3e starter kit, therefore I could test
my vhdl code in real, could ...

Anyway, I'm using ISE 9.1 Sp3 Webpack for Linux and  usr-driver.so from
http://www.rmdir.de/~michael/xilinx.

As mentioned in the README udev is configured right. Plugging the USB
got in /var/log/dmesg:

usb 4-5.4: new high speed USB device using ehci_hcd and address 4
usb 4-5.4: configuration #1 chosen from 1 choice
usb 4-5.4: USB disconnect, address 4
usb 4-5.4: new full speed USB device using ehci_hcd and address 5
usb 4-5.4: not running at top speed; connect to a high speed hub
usb 4-5.4: configuration #3 chosen from 1 choice

The green LED is on.

lsubs got:
Bus 004 Device 002: ID 04b4:6560 Cypress Semiconductor Corp. CY7C65640
USB-2.0 "TetraHub"
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 004: ID 046d:abd0 Logitech, Inc.
Bus 003 Device 003: ID 046d:c50c Logitech, Inc.
Bus 003 Device 002: ID 0451:2036 Texas Instruments, Inc. TUSB2036 Hub
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000

There is nothing new. Calling impact using as root:
LD_PRELOAD=/opt/Xilinx91i/bin/lin/libusb-driver.so
/opt/Xilinx91i/bin/lin/impact

got:

Connecting to cable (Usb Port - USB21).
Checking cable driver.
File version of /opt/Xilinx91i/bin/lin/xusbdfwu.hex = 1025(dec), 0x0401.
File version of /etc/hotplug/usb/xusbdfwu.fw/xusbdfwu.hex = 1025(dec),
0x0401.
 libusb-driver.so version: 2007-05-27 00:37:02.
Cable connection failed.
Reusing B4020002 key.
Reusing 38020002 key.
Reusing B5020002 key.
Reusing 39020002 key.
Reusing B6020002 key.
Reusing 3A020002 key.
Reusing B7020002 key.
Reusing 3B020002 key.
PROGRESS_END - End Operation.
Elapsed time =      2 sec.
Cable autodetection failed.

After plug off and plug in again, the green LED is off.

Kernel is 2.6.21 (debian/testing), Impact 9.1.03i.

Compiling the xilinx stuff suffers/fails from wrong kernel version depency.

Thanks
Olaf
Hi,

did some more tries. Writing the Firmware to the USB Controller using
fxload got:

# /sbin/fxload -v -t fx2 -I /opt/Xilinx91i/bin/lin/xusbdfwu.hex -D
/proc/bus/usb/004/010
microcontroller type: fx2
single stage:  load on-chip memory
open RAM hexfile image /opt/Xilinx91i/bin/lin/xusbdfwu.hex
stop CPU
write on-chip, addr 0x1d29 len   10 (0x000a)
write on-chip, addr 0x06d9 len   12 (0x000c)
write on-chip, addr 0x170d len   81 (0x0051)
write on-chip, addr 0x0c4c len  536 (0x0218)
write on-chip, addr 0x156e len  120 (0x0078)
write on-chip, addr 0x1c59 len   23 (0x0017)
write on-chip, addr 0x0090 len  232 (0x00e8)
write on-chip, addr 0x06e5 len  584 (0x0248)
write on-chip, addr 0x15e6 len  112 (0x0070)
write on-chip, addr 0x1d44 len    6 (0x0006)
write on-chip, addr 0x1c9c len   21 (0x0015)
write on-chip, addr 0x175e len   73 (0x0049)
write on-chip, addr 0x1cb1 len   20 (0x0014)
write on-chip, addr 0x1962 len   65 (0x0041)
write on-chip, addr 0x1af5 len   46 (0x002e)
write on-chip, addr 0x1000 len  475 (0x01db)
write on-chip, addr 0x12fd len    3 (0x0003)
write on-chip, addr 0x092d len    5 (0x0005)
write on-chip, addr 0x19bb len   59 (0x003b)
write on-chip, addr 0x1cfa len   13 (0x000d)
write on-chip, addr 0x12ab len   82 (0x0052)
write on-chip, addr 0x1cc5 len   18 (0x0012)
write on-chip, addr 0x1d13 len   11 (0x000b)
write on-chip, addr 0x1cd7 len   18 (0x0012)
write on-chip, addr 0x1d50 len    5 (0x0005)
write on-chip, addr 0x0178 len 1008 (0x03f0)
write on-chip, addr 0x0568 len  369 (0x0171)
write on-chip, addr 0x1b23 len   44 (0x002c)
write on-chip, addr 0x1c1c len   20 (0x0014)
write on-chip, addr 0x1ac6 len   47 (0x002f)
write on-chip, addr 0x1b4f len   44 (0x002c)
write on-chip, addr 0x18d8 len   70 (0x0046)
write on-chip, addr 0x1c30 len   17 (0x0011)
write on-chip, addr 0x0043 len    3 (0x0003)
write on-chip, addr 0x0053 len    3 (0x0003)
write on-chip, addr 0x1300 len  184 (0x00b8)
write on-chip, addr 0x0932 len    2 (0x0002)
write on-chip, addr 0x1bf6 len   38 (0x0026)
write on-chip, addr 0x1c41 len   24 (0x0018)
write on-chip, addr 0x19a3 len   22 (0x0016)
write on-chip, addr 0x1c70 len   22 (0x0016)
write on-chip, addr 0x1800 len  144 (0x0090)
write on-chip, addr 0x0ffe len    2 (0x0002)
write on-chip, addr 0x17fe len    2 (0x0002)
write on-chip, addr 0x1d5d len   31 (0x001f)
write on-chip, addr 0x1a96 len   48 (0x0030)
write on-chip, addr 0x19b9 len    2 (0x0002)
write on-chip, addr 0x0934 len    4 (0x0004)
write on-chip, addr 0x1890 len   72 (0x0048)
write on-chip, addr 0x1ba5 len   41 (0x0029)
write on-chip, addr 0x17f0 len   14 (0x000e)
write on-chip, addr 0x1b7b len   42 (0x002a)
write on-chip, addr 0x17a7 len   73 (0x0049)
write on-chip, addr 0x19f6 len   56 (0x0038)
write on-chip, addr 0x1d3c len    8 (0x0008)
write on-chip, addr 0x1d4a len    6 (0x0006)
write on-chip, addr 0x0080 len   16 (0x0010)
write on-chip, addr 0x1d07 len   12 (0x000c)
write on-chip, addr 0x1d1e len   11 (0x000b)
write on-chip, addr 0x1d33 len    9 (0x0009)
write on-chip, addr 0x0938 len    4 (0x0004)
write on-chip, addr 0x000b len    3 (0x0003)
write on-chip, addr 0x1a2e len   52 (0x0034)
write on-chip, addr 0x0033 len    3 (0x0003)
write on-chip, addr 0x1d55 len    4 (0x0004)
write on-chip, addr 0x093c len  149 (0x0095)
write on-chip, addr 0x13b8 len  156 (0x009c)
write on-chip, addr 0x1bce len   40 (0x0028)
write on-chip, addr 0x16b3 len   90 (0x005a)
write on-chip, addr 0x1c86 len   22 (0x0016)
write on-chip, addr 0x1a62 len   52 (0x0034)
write on-chip, addr 0x1656 len   93 (0x005d)
write on-chip, addr 0x1d59 len    4 (0x0004)
write on-chip, addr 0x1ce9 len   17 (0x0011)
write on-chip, addr 0x191e len   68 (0x0044)
write on-chip, addr 0x11db len  208 (0x00d0)
write on-chip, addr 0x1454 len  142 (0x008e)
write on-chip, addr 0x0f98 len  102 (0x0066)
write on-chip, addr 0x0e64 len  308 (0x0134)
write on-chip, addr 0x0000 len    3 (0x0003)
write on-chip, addr 0x14e2 len   12 (0x000c)
write on-chip, addr 0x09d2 len  555 (0x022b)
write on-chip, addr 0x14ee len  128 (0x0080)
write on-chip, addr 0x09d1 len    1 (0x0001)
write on-chip, addr 0x0bfd len   79 (0x004f)
... WROTE: 7435 bytes, 85 segments, avg 87
reset CPU

Writing the firmware on windows flash the USB LED red, at this LED off
for about 2 sec and green again. As I understood udev on linux this
should be called automatically if the vendor ID on bus appeared:

SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="0008", NAME="windrvr6"
BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd",
SYSFS{idProduct}=="0007", RUN+="/sbin/fxload -v -t fx2 -I
/opt/Xilinx91i/bin/lin/xusbdfwu.hex -D $TEMPNODE"
BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd",
SYSFS{idProduct}=="0009", RUN+="/sbin/fxload -v -t fx2 -I
/opt/Xilinx91i/bin/lin/xusbdfwu.hex -D $TEMPNODE"
BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd",
SYSFS{idProduct}=="000b", RUN+="/sbin/fxload -v -t fx2 -I
/opt/Xilinx91i/bin/lin/xusbdfwu.hex -D $TEMPNODE"
BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd",
SYSFS{idProduct}=="000d", RUN+="/sbin/fxload -v -t fx2 -I
/opt/Xilinx91i/bin/lin/xusbdfwu.hex -D $TEMPNODE"
BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd",
SYSFS{idProduct}=="000f", RUN+="/sbin/fxload -v -t fx2 -I
/opt/Xilinx91i/bin/lin/xusbdfwu.hex -D $TEMPNODE"

Something wrong?

Thanks
Olaf


> SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="0008", NAME="windrvr6" > BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", > SYSFS{idProduct}=="0007", RUN+="/sbin/fxload -v -t fx2 -I > /opt/Xilinx91i/bin/lin/xusbdfwu.hex -D $TEMPNODE" > BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", > SYSFS{idProduct}=="0009", RUN+="/sbin/fxload -v -t fx2 -I > /opt/Xilinx91i/bin/lin/xusbdfwu.hex -D $TEMPNODE" > BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", > SYSFS{idProduct}=="000b", RUN+="/sbin/fxload -v -t fx2 -I > /opt/Xilinx91i/bin/lin/xusbdfwu.hex -D $TEMPNODE" > BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", > SYSFS{idProduct}=="000d", RUN+="/sbin/fxload -v -t fx2 -I > /opt/Xilinx91i/bin/lin/xusbdfwu.hex -D $TEMPNODE" > BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03fd", > SYSFS{idProduct}=="000f", RUN+="/sbin/fxload -v -t fx2 -I > /opt/Xilinx91i/bin/lin/xusbdfwu.hex -D $TEMPNODE" > > Something wrong?
Yes, as the README says, the line ACTION=="add", BUS=="usb", SYSFS{idVendor}=="03fd", MODE="666" is required! Now it works, huray! Thanks Olaf
Hi,

On Sat, 09 Jun 2007 08:46:31 +0200, Olaf wrote:
> usb 4-5.4: new full speed USB device using ehci_hcd and address 5 > usb 4-5.4: not running at top speed; connect to a high speed hub > usb 4-5.4: configuration #3 chosen from 1 choice > > The green LED is on.
Green on a S3E starter kit means that the cypress usb firmware is running. Did you connect the board on windows and booted to linux without power-cycling the board?
> lsubs got: > Bus 004 Device 002: ID 04b4:6560 Cypress Semiconductor Corp. CY7C65640 > USB-2.0 "TetraHub" > Bus 004 Device 001: ID 0000:0000
Did you connect the board to a hub? If so, try it without the hub. It should show up the following when the green led is off: Bus 002 Device 009: ID 03fd:000d Xilinx, Inc. And when the firmware is loaded (green led on): Bus 002 Device 012: ID 03fd:0008 Xilinx, Inc.
> Connecting to cable (Usb Port - USB21). > Checking cable driver. > Cable autodetection failed.
Impact is specifically looking for an USB device with the ID 03fd:0008 and can't find it. The flashing with red led you described in your other post is downloading the cpld image and should only happen when you upgrade ISE and there is a new version available.
> Kernel is 2.6.21 (debian/testing), Impact 9.1.03i.
Should work.
> Compiling the xilinx stuff suffers/fails from wrong kernel version depency.
And won't help if you do not see the download cable in the lsusb-output. Regards, Michael
Hello Michael,

now it works, the problem was I thought that the mentioned udev line in
the readme is optional, which isn't. After adding the line it works.

Thanks
Olaf