cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer
Observer
8,970 Views
Registered: ‎11-18-2009

Data format in FPGA configuration FLASH

Jump to solution

Hi,

 

I have a Spartan 6 with a SPI Flash used for configuration (not a Xilinx Flash Platform). There is a "small" hardware problem on the PCB and the JTAG doesn't work.

 

What I want is to program the SPI Flash using some programing tool and not using Impact -> JTAG -> FPGA.

 

Can anyone recommend me a document where it is described the data format which has to be written in SPI Flash. Can I write 1:1 the *.mcs file??

 

Thanks,

Paul

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Observer
Observer
11,487 Views
Registered: ‎11-18-2009

Re: Data format in FPGA configuration FLASH

Jump to solution

hi,

 

Finally I also had to generate the  *.bin. The hex is ok but it is easier with *.bin. 

 

This is what I did:

1. Generate *.bit

2. Generate *.mcs

3. use "promgen.exe" to generate the bit. The comand is (Test.mcs - input, bTest.bin = output)

C:\Xilinx\14.4\ISE_DS\ISE\bin\nt64\promgen.exe -w -p bin -r Test.mcs -o bTest.bin

4. Load the bTest.bin in LabView application

5. Sent it USB -> UART -> FPGA -> SPI

 

And it worked!! 

 

Thanks you all for your help, ideas and suggestions.

 

Paul

View solution in original post

0 Kudos
9 Replies
Highlighted
Professor
Professor
8,967 Views
Registered: ‎08-14-2007

Re: Data format in FPGA configuration FLASH

Jump to solution

The .mcs file contains an image of the data that needs to go into the flash.  It's also got formatting, but

it is an industry standard and most standalone programmers can deal with this file type and do the

right thing for programming the flash.

 

Are you planning to do the programming in system or off-board?  For in-system programming,

assuming you have access to the flash signals and can remove or tri-state any other potential

drivers of these lines, there are a number of very inexpensive USB SPI flash programming adapters.

-- Gabor
0 Kudos
Highlighted
Observer
Observer
8,964 Views
Registered: ‎11-18-2009

Re: Data format in FPGA configuration FLASH

Jump to solution

Hi Gabor,

 

Thanks for replay.

No I'm planning to do it by myself using a FPGA board. I have all the VHDL modules which I need: UART - USB , I have an SPI-Flash modul. 

I send data from LabView / PC -> USB - UART -> to a RAM Buffer in FPGA and then when the Buffer is full to the SPI module and in the FLASH. Buffer is not big enough so I have to split data in several (x100) packages. I did in the past exactly the same for a I2C EEPROM. Only have to make some small changes. For a 128kB I2C EEPROM it took aprox. 10sec. I hope for my aprox. 900kB *.mcs shot thake 1 min.  But it is better than nothing.

 

So, back to the topic. If my *.mcs (first lines) looks lke:

 

:020000040000FA
:10000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00
:100010005599AA660C8500E004008C85C0018C828D
:10002000BC008C8690778C43200000C90C8700F3BD
:100030000C83008104000400040004000400040098
:100040000400040004000400040004000400040090
:10005000040004000400CC813C138C8110812C84AA
:1000600000004C8000F88C87FFFFCC8400A0CC827D
:100070000020CC8080004C8600004C8100004C8524
:1000800000004C8300004C870000CC85D847CC434F

 

how should the first bytes to look like?? I suppose the ":" must be left aside, 10000, 10001 ... are some addresses. 

 

Paul

0 Kudos
Highlighted
Teacher
Teacher
8,960 Views
Registered: ‎09-09-2010

Re: Data format in FPGA configuration FLASH

Jump to solution
http://www.lmgtfy.com/?q=mcs+file+format

------------------------------------------
"If it don't work in simulation, it won't work on the board."
Highlighted
Observer
Observer
8,955 Views
Registered: ‎11-18-2009

Re: Data format in FPGA configuration FLASH

Jump to solution

0 Kudos
Highlighted
Professor
Professor
8,950 Views
Registered: ‎08-14-2007

Re: Data format in FPGA configuration FLASH

Jump to solution

If your .mcs file only contains a bitstream and not other stuff, you could also forego

generating the .mcs file altogether and just create a .bin file when you run bitgen.

The .bin file is simple raw binary and corresponds to the portion of the .bit file after

the header.  For SPI flash this is exactly what ends up in the .mcs file (bit order is MSB first).

 

Another thing we've done is to use the .bit file itself and find the start of the actual bitstream

(end of header) which starts with a number of 0xFF bytes followed by 0xAA 0x99 0x55 0x66.

Then we'd program the header into a separate area in the flash so we could easily determine

the creation date.

-- Gabor
Highlighted
Historian
Historian
8,939 Views
Registered: ‎02-25-2008

Re: Data format in FPGA configuration FLASH

Jump to solution

@therealpaulie wrote:

Hi,

 

I have a Spartan 6 with a SPI Flash used for configuration (not a Xilinx Flash Platform). There is a "small" hardware problem on the PCB and the JTAG doesn't work.

 

What I want is to program the SPI Flash using some programing tool and not using Impact -> JTAG -> FPGA.

 

Can anyone recommend me a document where it is described the data format which has to be written in SPI Flash. Can I write 1:1 the *.mcs file??

 

Thanks,

Paul


When I did this (microprocessor on the system reading a flash and then configuring the FPGA by bit-banging), I didn't bother with an MCS file. I had the tools generate the .bin file which I stored in my flash (some kind of SPI thing).

 

Obviously iMPACT could not program the flash, which wasn't really a concern.

----------------------------Yes, I do this for a living.
Highlighted
Observer
Observer
11,488 Views
Registered: ‎11-18-2009

Re: Data format in FPGA configuration FLASH

Jump to solution

hi,

 

Finally I also had to generate the  *.bin. The hex is ok but it is easier with *.bin. 

 

This is what I did:

1. Generate *.bit

2. Generate *.mcs

3. use "promgen.exe" to generate the bit. The comand is (Test.mcs - input, bTest.bin = output)

C:\Xilinx\14.4\ISE_DS\ISE\bin\nt64\promgen.exe -w -p bin -r Test.mcs -o bTest.bin

4. Load the bTest.bin in LabView application

5. Sent it USB -> UART -> FPGA -> SPI

 

And it worked!! 

 

Thanks you all for your help, ideas and suggestions.

 

Paul

View solution in original post

0 Kudos
Highlighted
Observer
Observer
8,894 Views
Registered: ‎11-18-2009

Re: Data format in FPGA configuration FLASH

Jump to solution

Just figured out a easier way to generate *.bin.

 

In ISE Project Manager, Generate Programming File (right click) Process Properties\General Options -> there is a Property "Create Binary Configuration File" -g Binary. I checked it and now it generates directly the *.bin file.

I don't have to use impact to generate mcs and then *bit.  

0 Kudos
Highlighted
Newbie
Newbie
8,650 Views
Registered: ‎02-07-2014

Re: Data format in FPGA configuration FLASH

Jump to solution

Hi Paul,

I am Trung, I am so configuration FPGA (ARM microprocessor reading data from flash and then configuration FPGA throung Slave serial mode ) But I haven't choose .mcs or .bin file format and how is solution send data from microprocessor to  FPGA? you can show me solution :). and the begining of mcs file have word 020000040000FA.I don't know this mean. hope your help! thank you

0 Kudos