cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Newbie
Newbie
22,731 Views
Registered: ‎04-17-2008

impact dies programming SPI flash under linux

We're in the middle of producing a device that uses a Spartan 3E device programmed from an SPI flash. Early samples we programmed the flash before assembly, but now we want to program post assembly, using the Xilinx programming cable (either parallel or USB) and impact.

I've installed Impact under CentOS 5 linux, and I've successfully programmed the FPGA in our design using the default boundry scan GUI method, and I've also programmed the Xilinx Platform Flash on our original prototypes. However, programming the SPI flash on our new devices (tested successfully under Windows) causes impact to die. In batch mode I get the following error:

> program -p 1
Validating device...
sigsegv.
terminate called without an active exception
sigabort.
Aborted
[root@dhcp61 ~]#

I've once managed to program an SPI flash and not had it die, but pretty much all other times (20 or so times by now) the system dies. I've tried both USB and Parallel cables, and I've tried both the GUI and the command line batch mode, and the GUI just dies with no error message, and the command line dies with the above message.

The Impact I'm using comes from the 10.1 webkit download and reports: Release 10.1 - iMPACT K.31 (lin)

The script I'm using in batch mode is:

setmode -spi
setcable -p auto
addDevice -p 1 -spi M25P40 -file /home/mwd/spi1.mcs
program -p 1

Any advice welcome, as we'd ideally use linux for testing as we can then automate program and test of the board, where as if we use Windows we'd have to download on one machine then test on a linux box still.

Below is a full dump of what happens if I run that through impact batch mode.


[root@dhcp61 ~]# impact -batch
Release 10.1 - iMPACT K.31 (lin)
Copyright (c) 1995-2008 Xilinx, Inc. All rights reserved.
Preference Table
Name Setting
StartupClock Auto_Correction
AutoSignature False
KeepSVF False
ConcurrentMode False
UseHighz False
ConfigOnFailure Stop
UserLevel Novice
MessageLevel Detailed
svfUseTime false
SpiByteSwap Auto_Correction
>setmode -spi
setcable -p auto
addDevice -p 1 -spi M25P40 -file /home/mwd/spi1.mcs
>AutoDetecting cable. Please wait.
Reusing 7800FC81 key.
Reusing FC00FC81 key.
OS platform = i686.
Connecting to cable (Parallel Port - parport0).
WinDriver v9.00 Jungo (c) 1997 - 2007 Build Date: Mar 27 2007 X86 32bit
22:31:22.
parport0: baseAddress=0x378, ecpAddress=0x0
LPT base address = 0378h.
ECP base address = 0000h.
Cable connection failed.
Reusing 7900FC81 key.
Reusing FD00FC81 key.
OS platform = i686.
Connecting to cable (Parallel Port - parport1).
WinDriver v9.00 Jungo (c) 1997 - 2007 Build Date: Mar 27 2007 X86 32bit
22:31:22.
Cable connection failed.
Reusing 7A00FC81 key.
Reusing FE00FC81 key.
OS platform = i686.
Connecting to cable (Parallel Port - parport2).
WinDriver v9.00 Jungo (c) 1997 - 2007 Build Date: Mar 27 2007 X86 32bit
22:31:22.
Cable connection failed.
Reusing 7B00FC81 key.
Reusing FF00FC81 key.
OS platform = i686.
Connecting to cable (Parallel Port - parport3).
WinDriver v9.00 Jungo (c) 1997 - 2007 Build Date: Mar 27 2007 X86 32bit
22:31:22.
Cable connection failed.
Reusing A000FC81 key.
Reusing 2400FC81 key.
OS platform = i686.
Connecting to cable (Usb Port - USB21).
Checking cable driver.
File version of /opt/Xilinx/10.1/ISE/bin/lin/xusbdfwu.hex = 1030.
File version of /usr/share/xusbdfwu.hex = 1030.
WinDriver v9.00 Jungo (c) 1997 - 2007 Build Date: Mar 27 2007 X86 32bit
22:31:22.
Cable PID = 0008.
Max current requested during enumeration is 74 mA.
Type = 0x0004.
Cable Type = 3, Revision = 0.
Setting cable speed to 6 MHz.
Cable connection established.
Firmware version = 1302.
File version of /opt/Xilinx/10.1/ISE/data/xusb_xlp.hex = 1302.
Firmware hex file version = 1302.
Type = 0x0004.
ESN option: 00001165EB1F01.
PLD file version = 0012h.
PLD version = 0012h.
>INFO:iMPACT:501 - '1': Added Device M25P40 successfully.
----------------------------------------------------------------------
----------------------------------------------------------------------
'1': Loading file '/home/mwd/spi1.mcs' ...
INFO:iMPACT - Elapsed time = 0 sec.
done.
>program -p 1
Validating device...
sigsegv.
terminate called without an active exception
sigabort.
Aborted
[root@dhcp61 ~]#
0 Kudos
8 Replies
Highlighted
Xilinx Employee
Xilinx Employee
22,712 Views
Registered: ‎01-21-2008

Hi, This could be related to four things:

   1. Generation of MCS file.
   2. SPI IDCODE mismatching.
   3. The speed of the programming cable.
   4. USB drive might not have root permission.

Option-1: Generation of MCS file:

    1. While generating the MCS file please do not specify the PROM density (Auto select Density) & generate the MCS file
    2. Command line for generating the SPI MCS file => promgen -w -p mcs -c FF -o OUTPUT_FILE_NAME -u 0 INPUT _FILE_NAME.bit -s 65536 –spi

Option-2: SPI IDCODE mismatching:

    1. The generated file MCS and the physical h/w SPI IDCODE might be having some difference.
    2. This could be the issue of SPI programming interface issue i.e. SI issues as well. Please see the option-3 for more details.

Option-3: The speed of the programming cable:

 

    1. Some times the SPI programming can’t handle the SCK/TCK default clock speed.
    2. SPI is really sensitive for noise on TCK/SCK.  Please try following change in batch mode and let me know the results:
    3. IMPACT BATCH File:

            * For Parallel-IV programming cable:
                                                        i.      setMode -spi
                                                        ii.      setCable -port lpt1
                                                        iii.      setCableSpeed -speed 625000
                                                        iv.      addDevice -p 1 -spi M25P16 -file C:/home/mwd/spi1.mcs
                                                        v.      Erase -p 1
                                                        vi.      Program -p 1
                                                        vii.      Verify -p 1
                                                        viii.      quit
             * For USB programming cable:
                                                        i.      setMode –spi
                                                        ii.      setCable -port usb21 -baud 750000
                                                        iii.      addDevice -p 1 -spi M25P16 -file C:/home/mwd/spi1.mcs
                                                        iv.      Erase -p 1
                                                        v.      Program -p 1
                                                        vi.      Verify -p 1
                                                        vii.      quit

    ** If above suggestions are not helping you to sort out this issue, then please send me IMPACT log or try the bottom option-4.

Option-4: Install LibUSB drivers for Platform Cable USB/USB-II:

    1. The LibUSB package: Required by client applications for use of the cable. This package may have been included in the users Linux distribution.

        The installation of this component does not           necessarily require root permission.
    2. This issue might be related to the standard driver which is provided with ISE software might have user access permission on Linux OS.

        So try to install LibUSB drivers and this will resolve your issue.
    3. Go through the online answer record (AR#29310) for How to install LibUSB drivers on Linux OS - http://www.xilinx.com/support/answers/29310.htm

Message Edited by shashi on 07-31-2008 10:55 AM
0 Kudos
Highlighted
Newbie
Newbie
19,800 Views
Registered: ‎07-02-2008

Hello, I'll hijack this thread because I've got similar problems.

 

Device: Spartan 3e50. Already followed you instructions above.

 

Here's (part of) the log you requested:

 




 OS platform = i686.
Using libusb.
Connecting to cable (Usb Port - usb21).
Checking cable driver.
File version of /home/alex/Software/xilinx/ISE_10.1/ISE/bin/lin/xusbdfwu.hex =
1030.
File version of /usr/share/xusbdfwu.hex = 1030.
Using libusb.
Max current requested during enumeration is 74 mA.
Type = 0x0004.
Cable Type = 3, Revision = 0.
Setting cable speed to 750 KHz.
Cable connection established.
Firmware version = 1302.
File version of /home/alex/Software/xilinx/ISE_10.1/ISE/data/xusb_xlp.hex =
1302.
Firmware hex file version = 1302.
PLD file version = 0012h.
PLD version = 0012h.
INFO:iMPACT:501 - '1': Added Device M25P16 successfully.
----------------------------------------------------------------------
----------------------------------------------------------------------
'1': Loading file 'test.mcs' ...
INFO:iMPACT - Elapsed time = 0 sec.
done.
Validating device...
terminate called without an active exception
sigsegv.
sigabort.
Message Edited by alebaba on 07-02-2008 11:12 PM
0 Kudos
Highlighted
Observer
Observer
19,613 Views
Registered: ‎01-20-2008

Hi,

did anybody ever find a solution to this problem. I'm running 10.1 + sp2 and still get this problem.
and going through a virtual machine just program the SPI is a bit of a pain.

Thanks,
Stephan
0 Kudos
Highlighted
Visitor
Visitor
19,563 Views
Registered: ‎07-07-2008

I'm seeing the same thing here with a DLC9G and an M25P16.  Very frustrating.  I tried connecting the DLC9G to an XC2C256 on a Digilent XC2-XL development board.  I was able to run the identify and blank check commands there without a problem.  If I move the DLC9G to a Windows machine, I'm able to talk to the M25P16.

 

 

0 Kudos
Highlighted
Visitor
Visitor
19,534 Views
Registered: ‎07-07-2008

To followup, here is the tail end of the output from strace.  As in my previous message, impact segfaults when I try to verify the SPI flash.  The flash was previously programmed using a Windows-hosted version of impact.

 

write(1, ">", 1)                        = 1
read(0, "verify -p 1\n", 4096)          = 12
time(NULL)                              = 1215526593
ioctl(4, USBDEVFS_CONTROL, 0xbfcffa2c)  = 0
ioctl(4, USBDEVFS_CONTROL, 0xbfcffa4c)  = 0
ioctl(4, USBDEVFS_CONTROL, 0xbfcff99c)  = 0
ioctl(4, USBDEVFS_CLAIMINTERFACE, 0xbfcff9d4) = 0
gettimeofday({1215526593, 613140}, NULL) = 0
ioctl(4, USBDEVFS_SUBMITURB, 0xbfcff974) = 0
ioctl(4, USBDEVFS_REAPURBNDELAY, 0xbfcff9b8) = -1 EAGAIN (Resource temporarily unavailable)
select(5, NULL, [4], NULL, {0, 1000})   = 1 (out [4], left {0, 1000})
gettimeofday({1215526593, 613556}, NULL) = 0
ioctl(4, USBDEVFS_REAPURBNDELAY, 0xbfcff9b8) = 0
ioctl(4, USBDEVFS_RELEASEINTERFACE, 0xbfcff9d4) = 0
ioctl(4, USBDEVFS_CONTROL, 0xbfcff9fc)  = 1
times({tms_utime=109, tms_stime=14, tms_cutime=0, tms_cstime=0}) = 496873815
times({tms_utime=109, tms_stime=14, tms_cutime=0, tms_cstime=0}) = 496873815
write(1, "Validating device...\n", 21)  = 21
ioctl(4, USBDEVFS_CONTROL, 0xbfcff6bc)  = 0
ioctl(4, USBDEVFS_CLAIMINTERFACE, 0xbfcff6f4) = 0
gettimeofday({1215526593, 679595}, NULL) = 0
ioctl(4, USBDEVFS_SUBMITURB, 0xbfcff694) = 0
ioctl(4, USBDEVFS_REAPURBNDELAY, 0xbfcff6d8) = -1 EAGAIN (Resource temporarily unavailable)
select(5, NULL, [4], NULL, {0, 1000})   = 1 (out [4], left {0, 0})
gettimeofday({1215526593, 680654}, NULL) = 0
ioctl(4, USBDEVFS_REAPURBNDELAY, 0xbfcff6d8) = 0
ioctl(4, USBDEVFS_RELEASEINTERFACE, 0xbfcff6f4) = 0
ioctl(4, USBDEVFS_CLAIMINTERFACE, 0xbfcff6f4) = 0
gettimeofday({1215526593, 683363}, NULL) = 0
ioctl(4, USBDEVFS_SUBMITURB, 0xbfcff694) = 0
ioctl(4, USBDEVFS_REAPURBNDELAY, 0xbfcff6d8) = -1 EAGAIN (Resource temporarily unavailable)
select(5, NULL, [4], NULL, {0, 1000})   = 1 (out [4], left {0, 0})
gettimeofday({1215526593, 684609}, NULL) = 0
ioctl(4, USBDEVFS_REAPURBNDELAY, 0xbfcff6d8) = 0
ioctl(4, USBDEVFS_RELEASEINTERFACE, 0xbfcff6f4) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
write(1, "sigsegv.\n", 9)               = 9
write(2, "terminate called without an acti"..., 45) = 45
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
tgkill(30833, 30833, SIGABRT)           = 0
--- SIGABRT (Aborted) @ 0 (0) ---
semop(98172943, 0xbfcff36e, 1)          = 0
semctl(98205712, 0, IPC_64|GETVAL, 0xbfcff318) = 4
semop(98205712, 0xbfcff34a, 1)          = 0
semop(98172943, 0xbfcff2ee, 1)          = 0
ioctl(4, USBDEVFS_RELEASEINTERFACE, 0xbfcff2d4) = -1 EINVAL (Invalid argument)
close(4)                                = 0
munmap(0xb7e9f000, 528384)              = 0
munmap(0xb7e1e000, 528384)              = 0
munmap(0xb7f20000, 135168)              = 0
semop(98172943, 0xbfcff31e, 1)          = 0
write(1, "sigabort.\n", 10)             = 10
sigreturn()                             = ? (mask now [SEGV])
rt_sigaction(SIGABRT, {SIG_DFL}, NULL, 8) = 0
tgkill(30833, 30833, SIGABRT)           = 0
--- SIGABRT (Aborted) @ 0 (0) ---
+++ killed by SIGABRT +++

0 Kudos
Highlighted
Visitor
Visitor
17,394 Views
Registered: ‎11-01-2007

I have the same problem here. My installation is a ISE Foundation 10.1 in Ubuntu 8.04... I hope it will be fixed soon!!
0 Kudos
Highlighted
Visitor
Visitor
17,376 Views
Registered: ‎11-01-2007

I've found a workaround that may help you. With Xilinx Impact 9.2i the USB cable works fine in Linux.

 

Then, you can use Xilinx ISE 10.1 for creating the programming file, but use the old version of Impact for programming the FPGA. This way, there's no need to use any virtual machine with Windows... 

Highlighted
Visitor
Visitor
17,335 Views
Registered: ‎07-07-2008

This problem has been confirmed by Xilinx.  The change request for this issue is #480786.

 

0 Kudos