Jump to content
  • 0

Can not program Spartan 6 in Ubuntu 14.04 with JTAG HS2


jutlwj

Question

Hi, I am trying to program Spartan 6 FPGA(6SLX25FTG256) with Jtag HS2 in Ubuntu 14.04. I can see the device with command "sudo djtgcfg enum":

Found 1 device(s)

Device: JtagHs2
    Product Name:   Digilent JTAG-HS2
    User Name:      JtagHs2
    Serial Number:  210249A143CA
I can also detect the FPGA using command "sudo djtgcfg init -d JtagHs2":

Initializing scan chain...
Found Device ID: 24004093

Found 1 device(s):
    Device 0: XC6SLX ? 
But when I tried to program the FPGA, it always failed. I tried with .bit file first using the following command:

sudo djtgcfg prog -d JtagHs2 -i 0 -f fpga_firmware.bit

Then it gave the following error:

"ERROR: failed to set programming file"

I then suspected it might be permission issue of the fpga firmware. I then changed the permission for both .bit and .bin files:

sudo chmod 777 fpga_firmware.bit

sudo chmod 777 fpga_firmware.bin

and then tried to program again. But it gave the same error--- "ERROR: failed to set programming file".

I then tried to program with .bin file:

sudo djtgcfg prog -d JtagHs2 -i 0 -f fpga_firmware.bin

This time it seems it recognizes the file and start to program, but it fails and gives error like this:

"Programming device. Do not touch your board. This may take a few minutes...
ERROR: failed to program device with file fpga_firmware.bin"

It seems that the Digilent Adept software I installed does not support Xilinx Spartan 6. Could anyone tell me what is wrong? Why it can not program Spartan 6?

Thank you.

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

Hmm ... I'm programming the Spartan-6 without a problem on Ubunto 14.04.4.  I'm currently using the commands:

djtgcfg enum
djtgcfg init -d CmodS6
djtgcfg prog -d CmodS6 -i 0 -f filename.bit

I'm also using version 2.2.1-x86_64 of the utilities and 2.16.1-x86_64 of the runtime.  The big difference I see is that I'm not using sudo.  After that I might wonder if your bit file is valid.  Can you do an ls -l on your bitfile, so that we can get an idea how big it is and whether or not it is full sized?  Also od -t x1 filename.bit | head might be useful as well, just to verify that the header looks good.

After that, I might need to bow out and wait for a real Digilent employee to try to help.

Yours,

Dan

Link to comment
Share on other sites

Thank you for your help Dan. There is no problem with the bit file as I can program my Spartan 6 FPGA through Vivado using the same bit file and same Jtag HS2, and I have proved the FPGA firmware works. "ls -l fpga_firmware.bit"  shows it has size of 801571 bytes. " od -t x1 fpga_firmware.bit | head" shows the following contents:

0000000 00 09 0f f0 0f f0 0f f0 0f f0 00 00 01 61 00 2e
0000020 73 74 65 72 65 6f 2e 6e 63 64 3b 48 57 5f 54 49
0000040 4d 45 4f 55 54 3d 46 41 4c 53 45 3b 55 73 65 72
0000060 49 44 3d 30 78 46 46 46 46 46 46 46 46 00 62 00
0000100 0d 36 73 6c 78 32 35 66 74 67 32 35 36 00 63 00
0000120 0b 32 30 31 36 2f 30 34 2f 32 36 00 64 00 09 31
0000140 34 3a 32 36 3a 34 36 00 65 00 0c 3a b6 ff ff ff
0000160 ff ff ff ff ff ff ff ff ff ff ff ff ff aa 99 55
0000200 66 30 a1 00 07 20 00 31 a1 04 88 31 41 3d 08 31
0000220 61 09 ee 31 c2 04 00 40 93 30 e1 00 cf 30 c1 00
 

What made me very confused is that I can not program my Spartan 6 FPGA using the command line "sudo djtgcfg prog -d JtagHs2 -i 0 -f fpga_firmware.bit". Due to the limit of my project, I can not always use Vivado to program my FPGA and I have to get programming with command line work. It seems something is missing but I do not know what it is.

Link to comment
Share on other sites

Okay, so the bit file header looks good--at least as far as I can tell which isn't very far.  The file size looks non-empty, so that's good too.

Have you been able to program this device with a JTAG controller before?  Is it possible that you have the device miswired?  Or, alternatively, are there multiple possible JTAG controls on your board that are ... competing with each other?  (I'm guessing here, hoping to see if the problem might lie somewhere else ...)

Dan

Link to comment
Share on other sites

Hi Dan,

There is only one FPGA device on my PCB board, and there is no wiring issue as I can program it through Vivado with the same Jtag HS2, although I can not program it using command "djtgcfg prog -d JtagHs2 -i 0 -f fpga_firmware.bit ". Unfortunately due to the requirement of the project, I can not always use Vivado to program my FPGA. By the way, I am using version 2.2.1-x86_64 of the utilities and 2.16.1-x86_64 of the runtime as well.

Link to comment
Share on other sites

Hi Dan,

Thank you very much for your help. I think it may have something to do with the version of libusb on my PC. Before you leave this question, could you please tell me which version of libusb are you using? Do you know where to check the libusb version in Ubuntu?

Link to comment
Share on other sites

Hi jutlwj,

I am not familiar with the Spartan 6 part that you listed (it is not present on any Digilent boards), but I will ask some of our applications engineers for a list of boards that Adept does support. If Adept does not support this board (the Spartan 6 that Dan listed is one of Digilent's boards which is why Adept was working nicely for him), you may need to use Xilinx ISE with iMPACT.

As a side note, I'm not sure how you're programming the Spartan 6 with Vivado since Vivado does not actively support any boards older than their 7-series boards...

Thanks,
JColvin

Link to comment
Share on other sites

Hi jutlwj,

I found out that Adept has not been designed to support that particular Spartan 6 chip and there are no plans to create support for that chip, so you would need to use ISE with iMPACT in order to program your board.

Thanks,
JColvin

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...