UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
8,090 Views
Registered: ‎05-23-2010

Bootloader for Spartan 6 with SPI FLash

Jump to solution

Hello all,

 

I am working on Spartan 6 FPGA with S25FL129 SPI Flash in ISE 12.4. I am trying to develop a bootloader application which will copy the main application from Flash to DDR2. I got the reference of S3A1800DSP Serial Flash Bitstream Update over Ethernet application from one of the forum threads. The script is for loading 3 bit files along with an application and its vectors into Spartan 3ADSP. I have modified this script for loading one bit file along with application and vectors into Spartan 6.

 

Following is the modified script:

 "

cd .

 

echo off

 

set bitstream1=top.bit

::set bitstream2=ledflash_routed_1.bit

::set bitstream3=ledflash_routed_2.bit

set application=CPL_UDP_Tx_app

set vector=CPL_UDP_Tx_vectors

set spiPartName=s25fl129

::set multiboot_offset=100000

::set backup_offset=200000

set app_offset=0x180000

set vector_offset=0x170000

 

::     Step 1. Convert download.bit and two application bits to mcs

 

@echo setPreference  -pref StartupClock:Auto_Correction                                   > create_mcs.cmd

@echo setPreference  -pref MessageLevel:Detailed                                         >> create_mcs.cmd

@echo setPreference  -pref SpiByteSwap:Auto_Correction                                   >> create_mcs.cmd 

@echo setMode        -promfile                                                           >> create_mcs.cmd

@echo setSubmode     -pffmbspi                                                           >> create_mcs.cmd

@echo setMbBpiDevice -device SPARTAN6LX                                                   >> create_mcs.cmd

@echo setMbBpiChain  -serial                                                             >> create_mcs.cmd

@echo setMbBpiType   -type TYPE_MB_SPI                                                   >> create_mcs.cmd

 

@echo addDesign      -version 0 -startaddress 000000                                     >> create_mcs.cmd

@echo addDeviceChain -index 0                                                            >> create_mcs.cmd

@echo addDevice      -p 1 -file %bitstream1%                                             >> create_mcs.cmd

 

::@echo addDesign      -version 1 -startaddress %multiboot_offset%                         >> create_mcs.cmd

::@echo addDeviceChain -index 0                                                            >> create_mcs.cmd

::@echo addDevice      -p 1 -file %bitstream2%                                             >> create_mcs.cmd

 

::@echo addDesign      -version 2 -startaddress %backup_offset%                            >> create_mcs.cmd

::@echo addDeviceChain -index 0                                                            >> create_mcs.cmd

::@echo addDevice      -p 1 -file %bitstream3%                                             >> create_mcs.cmd

 

@echo generate       -format mcs -generic -spi -fillvalue FF -output bitstream.mcs       >> create_mcs.cmd

@echo quit                                                                               >> create_mcs.cmd

D:\Xilinx\12.4\ISE_DS\ISE\bin\nt\impact -batch create_mcs.cmd

 

::     Step 2. Convert binary application and vectors to mcs

xmcsutil -accept_notice -i %application%.b -o %application%.mcs -29

xmcsutil -accept_notice -i %vector%.b -o %vector%.mcs -29

 

::     Step 3. combine bitstream, application, and vector mcs files

xmcsutil -accept_notice -i bitstream.mcs %application%.mcs %vector%.mcs -o combined.mcs -16 -segaddr 0x00 %app_offset% %vector_offset% -usedataaddr

 

 

::     Step 4. Program the S33 on the Sp3A DSP Starter board

:: For Platform Cable USB II and some I

xip -accept_notice -xopt 12 -skip_syncword_check -mcs -spi_epv -i combined.mcs -o verify.txt -select_cable 2

 

:: For some Platform Cable USB I

:: xip -accept_notice -skip_syncword_check -mcs -spi_epv -i combined.mcs -o verify.txt -select_cable 2

 

:: For Parallel Cable IV

:: xip -accept_notice -xopt 4 -skip_syncword_check -mcs -spi_epv -i combined.mcs -o verify.txt -select_cable 6

 

::     cleanup

::del *.cmd

::del *.prm

::del *.log

::del %application%.mcs

::del %vector%.mcs

::del bitstream.mcs

::del *.cfi

 

pause

 "

 

Even after making sure that Impact 12.4 is used, while creating the mcs for bit file, Impact gives following error:

INFO:iMPACT:2659 - Input device SPARTAN6LX is not valid.

   Valid devices are:

   SPARTAN3E, SPARTAN3A, VIRTEX5.

 

Is there anything else in the script that needs to be changed?

 

 

 

Regards,

 

wg

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Voyager
Voyager
9,956 Views
Registered: ‎10-01-2007

Re: Bootloader for Spartan 6 with SPI FLash

Jump to solution

Seems there are two different problems.  Your iMPACT script isn't working and you also have a problem with XILISF SREC bootloader.

 

Regarding iMPACT, I've found that the documentation for command-line syntax is not great.  However, if you launch a command prompt, and then launch iMPACT from there, iMPACT will produce a log and a .cmd that shows what operations were performed.  I did this using iMPACT 12.4 and worked up a Spartan-6 example.  I wanted to test this on hardware, so I targeted the Avnet Spartan-6 LX9 MicroBoard with Micron N25Q128.  It's not the same Flash as what you need, but I don't have access to a Spartan-6 board with the same Flash, so this was the best that I could do.

 

Your iMPACT issue was a matter of using the correct flags to generate a PROM file.  If that part had succeeded you would have had another issue trying to use XIP with the S25FL129.  The N25Q128 and S25FL129 are both supported by iMPACT, so you can use iMPACT to program them through the JTAG header.

 

I am attaching an example that takes an S6LX9 bitstream, converts it to MCS, then programs it to Flash.  Change the .txt file to .bat and then run the batch file.  This shows the PROM file creation and iMPACT programming.  You'll have to add in the other lines from the previous batch file for generating the other files and combining together for the full bootloading system.

 

Regarding the XILISF, there should only be minor differences between the N25Q128 and S25FL129.  I suggest you post a question on the Avnet Forum for this board about that, and the author of that tutorial should be able to give you some additional info. 

http://community.em.avnet.com/t5/Spartan-6-LX9-MicroBoard/bd-p/Spartan-6LX9MicroBoard

 

Bryan

3 Replies
Adventurer
Adventurer
8,085 Views
Registered: ‎05-23-2010

Re: Bootloader for Spartan 6 with SPI FLash

Jump to solution

Hello all,

 

I have also implemented the method suggested in this document EDK - Creating a MicroBlaze SPI Flash Bootloader (Zip). It uses modified version of SDK SREC bootloader with XILISF library. The bootloader gives the following message when run:

"

SREC Bootloader
Loading SREC image from flash @ address: 00170000
ERROR: Error while reading an SREC line from flash

"

 

In the document, the XILISF library is configured for Micron Flash. Can it also be used for Spansion Flash S26FL129?

 

 

Regards,

 

wg

0 Kudos
Highlighted
Voyager
Voyager
9,957 Views
Registered: ‎10-01-2007

Re: Bootloader for Spartan 6 with SPI FLash

Jump to solution

Seems there are two different problems.  Your iMPACT script isn't working and you also have a problem with XILISF SREC bootloader.

 

Regarding iMPACT, I've found that the documentation for command-line syntax is not great.  However, if you launch a command prompt, and then launch iMPACT from there, iMPACT will produce a log and a .cmd that shows what operations were performed.  I did this using iMPACT 12.4 and worked up a Spartan-6 example.  I wanted to test this on hardware, so I targeted the Avnet Spartan-6 LX9 MicroBoard with Micron N25Q128.  It's not the same Flash as what you need, but I don't have access to a Spartan-6 board with the same Flash, so this was the best that I could do.

 

Your iMPACT issue was a matter of using the correct flags to generate a PROM file.  If that part had succeeded you would have had another issue trying to use XIP with the S25FL129.  The N25Q128 and S25FL129 are both supported by iMPACT, so you can use iMPACT to program them through the JTAG header.

 

I am attaching an example that takes an S6LX9 bitstream, converts it to MCS, then programs it to Flash.  Change the .txt file to .bat and then run the batch file.  This shows the PROM file creation and iMPACT programming.  You'll have to add in the other lines from the previous batch file for generating the other files and combining together for the full bootloading system.

 

Regarding the XILISF, there should only be minor differences between the N25Q128 and S25FL129.  I suggest you post a question on the Avnet Forum for this board about that, and the author of that tutorial should be able to give you some additional info. 

http://community.em.avnet.com/t5/Spartan-6-LX9-MicroBoard/bd-p/Spartan-6LX9MicroBoard

 

Bryan

Adventurer
Adventurer
8,050 Views
Registered: ‎05-23-2010

Re: Bootloader for Spartan 6 with SPI FLash

Jump to solution

Hello Bryan, Thanks for the file and for the great tip of using the Impact cmd file. I am thinking of combining the file sent by you and the cmd file I get by adding the application and vector binary files and programming Flash using the GUI. For some reason, Impact repeats a lot of commands in the .cmd file, but they can be easily removed. Regards, wg

0 Kudos