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: 
Highlighted
Visitor neelmehta89
Visitor
10,647 Views
Registered: ‎04-06-2012

Reading and writing to Flash on Spartan 3E starter kit

I want to write a 1MB data file to the flash on my Spartan 3E starter kit. After the data is written, I want to read the data, process it and output it from the FPGA. The processing part has already been written in the form of a verilog code in Xilinx ISE.

 

Can someone guide me as to:

1. How to write the 1MB data file to the flash?

2. How do I read from flash and interface it with my Verilog code?

Tags (2)
0 Kudos
9 Replies
Teacher eteam00
Teacher
10,642 Views
Registered: ‎07-21-2009

Re: Reading and writing to Flash on Spartan 3E starter kit

Can someone guide me as to:

1. How to write the 1MB data file to the flash?

 

You should be able to access the configuration memories from iMPACT.  Have you tried this?

You can access the SPI and Strataflash memories from the FPGA

 

2. How do I read from flash and interface it with my Verilog code?

 

  • Select which memory you want to access.
  • Read the datasheet for the selected memory.
  • Write Verilog code which conforms to the timing and sequencing requirements described in the memory device datasheet.

-- Bob Elkind

SIGNATURE:
README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

Summary:
1. Read the manual or user guide. Have you read the manual? Can you find the manual?
2. Search the forums (and search the web) for similar topics.
3. Do not post the same question on multiple forums.
4. Do not post a new topic or question on someone else's thread, start a new thread!
5. Students: Copying code is not the same as learning to design.
6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please).
7. You are not charged extra fees for comments in your code.
8. I am not paid for forum posts. If I write a good post, then I have been good for nothing.
0 Kudos
Visitor neelmehta89
Visitor
10,636 Views
Registered: ‎04-06-2012

Re: Reading and writing to Flash on Spartan 3E starter kit

Can someone guide me as to:

1. How to write the 1MB data file to the flash?

 

You should be able to access the configuration memories from iMPACT.  Have you tried this?

You can access the SPI and Strataflash memories from the FPGA

 

Using iMPACT, can I write any file to the Flash or just write the complied code (.bit) to the flash? Also, I believe that the data needs to be written in specific block of memory so that it does not overlap with any other code written to flash (for example, verilog code which needs to be loaded into FPGA on boot). Am I correct?


 

2. How do I read from flash and interface it with my Verilog code?

 

  • Select which memory you want to access.

If I am correct, there are two flash memories - NOR Flash as well as SPI Flash. I am not sure which one I should use.

 

 

  • Read the datasheet for the selected memory.

After reading the datasheet, I can use the timing diagram and write a verilog code to access the memory. But I am looking for a simpler method. I know that using Xilinx Platform Studio (XPS), it generates BSP documentation which can be used in Xilinx SDK to write the code easily. I am looking for something on similar level.

 

I tried doing the same using Flash in XPS + SDK, but somehow the BSP documentation says that I cannot access flash using this process and I am completely confused.

 


  • Write Verilog code which conforms to the timing and sequencing requirements described in the memory device datasheet.

Any other alternative way than the above?

 

 

-- Bob Elkind

SIGNATURE:
README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

Summary:
1. Read the manual or user guide. Have you read the manual? Can you find the manual?
2. Search the forums (and search the web) for similar topics.
3. Do not post the same question on multiple forums.
4. Do not post a new topic or question on someone else's thread, start a new thread!
5. Students: Copying code is not the same as learning to design.
6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please).
7. You are not charged extra fees for comments in your code.
8. I am not paid for forum posts. If I write a good post, then I have been good for nothing.
0 Kudos
Teacher eteam00
Teacher
10,633 Views
Registered: ‎07-21-2009

Re: Reading and writing to Flash on Spartan 3E starter kit

Using iMPACT, can I write any file to the Flash or just write the complied code (.bit) to the flash? Also, I believe that the data needs to be written in specific block of memory so that it does not overlap with any other code written to flash (for example, verilog code which needs to be loaded into FPGA on boot). Am I correct?

 

Yes, you are correct.

 

Consider the possible uses you have for on-board memory:

  • configuration data
  • MicroBlaze code (if you use this in your design)
  • stored file

You have two non-volatile memories on the board:

  • SPI flash memory (which is a form of NOR flash memory)
  • StrataFlash memory (which is also a form of NOR flash memory)

I believe that the Spartan-3e device can boot (configure) from either of the two memories.

I believe that MicroBlaze (if you use this in your design) can run code from StrataFlash, but not SPI memory.

 

After sorting out how much memory space you need for configuration (the Spartan-3 configuration user guide tells you how much configuration data storage is needed) and MicroBlaze code, whatever you have remaining (and the memory address space which is remaining) is available for your file data.

 

There is no hard-wired memory interface controller in Spartan-3e devices which is available in "user" mode (rather than self-configuration mode).  You will need to provide the design of the memory interface controller, either by using existing code or writing your own code.  For either of the memories on the board, the interface is quite simple. The device datasheets provide good descriptions of the interfaces.

 

-- Bob Elkind

SIGNATURE:
README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

Summary:
1. Read the manual or user guide. Have you read the manual? Can you find the manual?
2. Search the forums (and search the web) for similar topics.
3. Do not post the same question on multiple forums.
4. Do not post a new topic or question on someone else's thread, start a new thread!
5. Students: Copying code is not the same as learning to design.
6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please).
7. You are not charged extra fees for comments in your code.
8. I am not paid for forum posts. If I write a good post, then I have been good for nothing.
0 Kudos
Visitor vharshit
Visitor
9,185 Views
Registered: ‎09-19-2013

Re: Reading and writing to Flash on Spartan 3E starter kit

Hi,

 

I am facing the same problem. I have created a NOR FLASH Controller and wanted to test on Intel Strata Flash Parallel NOR flash PROM(on board chip).

Confusion:-

1) Status bit has been speciifed as B18 pin of FPGA, while, creating ucf file B18 pin option is not available.

2) How can I access or choose the flash to access??

 

 

----

 

Yes, I am a new bee in the this field. Thanks for helping.

0 Kudos
Newbie harinirao
Newbie
9,045 Views
Registered: ‎02-05-2014

Re: Reading and writing to Flash on Spartan 3E starter kit

can u pls forward the processing part to write to the flash on spartan 3E starter kit and read the date, process it and output it from the FPGA written in the form of a verilog code in Xilinx ISE to email id harinirao.ec@gmail.com . As i am finding it hard and have to complete this within a short duration in my internship. it will be very helpfull if u do this to me.

 

thank u,

0 Kudos
Visitor xainalvi
Visitor
5,506 Views
Registered: ‎02-13-2016

Re: Reading and writing to Flash on Spartan 3E starter kit

0 Kudos
Xilinx Employee
Xilinx Employee
5,494 Views
Registered: ‎09-05-2007

Re: Reading and writing to Flash on Spartan 3E starter kit

The following reference designs with source code and documentation are available from...

 

http://www.xilinx.com/products/boards/s3estarter/reference_designs.htm

 

PicoBlaze RS-232 StrataFlash™ Programmer
Turns the Spartan-3E FPGA into an Intel StrataFlash programmer. The FPGA connects to a PC via an RS232 UART. Via HyperTerminal (not included), download an MCS file to the Intel StrataFlash parallel NOR Flash memory, check the memory ID, bulk erase the entire 128Mbit Flash, and read and write Flash data.

 

PicoBlaze Processor SPI Flash Programmer
Turns the Spartan-3E FPGA into an SPI serial Flash programmer. The FPGA connects to a PC via an RS232 UART. Via HyperTerminal (not included), download an MCS file to the STMicro M25P16 SPI Flash, check the memory ID, bulk erase the SPI Flash, and read Flash data.

 

 

Even if you do not use these designs in your final implementation they provide a way to peek, poke and erase the flash memories on this board and learn how these operations work.  

 

Ken Chapman
Principal Engineer, Xilinx UK
0 Kudos
Visitor xainalvi
Visitor
5,489 Views
Registered: ‎02-13-2016

Re: Reading and writing to Flash on Spartan 3E starter kit

Well sir the problem is that this is partially my fyp and i am a student. 

I have to use bluetooth to sent  in a bit file. save it on 1 board. Process its and sent it to another board's jtag programming it.

I dont think I will be allowed to use this. 

 

The problem is that I dont get as to why my basic code as posted above is not allowing me to write into strata flash. I can even read the files written on to my flash. ( using adept software to check).

 

Can u please help me debug my code ? or give me an idea as to why it is not working ?

0 Kudos
Xilinx Employee
Xilinx Employee
5,485 Views
Registered: ‎09-05-2007

Re: Reading and writing to Flash on Spartan 3E starter kit

'xainalvi' please see your original thread.

Ken Chapman
Principal Engineer, Xilinx UK
0 Kudos