Jump to content
  • 0

More on QSPI Flash - Zybo Z7-10


engrpetero

Question

I'm trying to make complete sense out of the QSPI Flash device on the Zybo Z7-10 as well as the BSP Xilinx example programs.  From my reading of the sparse comments in the example programs, the Zybo ref manual, and the Spansion datasheet for the memory (which I don't find on the Zybo schematic), it *seems* that 'normal' use of this memory suggests that 256-byte pages be read and written at a time. 

I've arranged my desired memory space to use such boundaries (I'm mostly storing objects with 8192 byte lengths).  I do occasionially desire to update single or dual byte entries on these pages.  I *assume* I'll need to read the page that has updates, update only those bytes I care to update, then write the entire page again if wanting to make such updates?

Also - the Erase commands listed (some of which are in the Xilinx driver files) seem to operate on 64Kbyte (or 256Kbyte) 'sectors'.  So similar to the question above, if I only want to 'erase' smaller sections of memory, I should probably just write a value (0xff) to the page I care to 'erase'?

image.thumb.png.d64b1f765ad2a160bd8a609031da97c7.png

Edited by engrpetero
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Now that I've reread the Flash datasheet a few times and looked more closely at the example applications, particularly the polled example, I can better frame questions.  Perhaps I need to ask the flash manufacturer, but I'll try here in case someone sees this thread and has already learned what I'm searching for.

The Spansion Flash is a 128MBit (16 MByte) memory device, comprised of (I believe) 65536 256-byte pages and 4000 4-kbyte sectors.

The Flash can operate in Linear or Quad mode.  Since the controller can handle it, seems silly to not use Quad mode which is presumably faster but perhaps I'm missing a reason to use Linear mode.  There are also Double-Data-Rate (DDR) commands that although not implemented in the example apps, can presumably double the data transfer speed.

For the Read commands (section 9.4 of the manual), they can start on any memory address and seem to be well defined.  In the Xilinx driver implementation, the 'FlashRead' command will read a specific number of bytes regardless of which of the modes (Read, Fast Read, Dual Output Read, Quad Output Read - and presumably the DDR reads) is used.

For the Write/Program commands (section 9.5 of the manual) - and to keep in mind, programing can only change single bits from 1 to 0.  Page Programming and Single Byte Programming seems to be possible though there are some caveats to the ECC when doing single byte programming.  The Xilinx implementation only does page programming.  Pages are 256 bytes (as mentioned above) to it wanting to program only part of a page, the page needs to be read to a buffer, the buffer modified, and then the page programmed again.  BUT... since programming can only set bits from 1 to 0, Erase operations to set all bits to '1' must be performed before programming can be done.

For the Erase commands (section 9.6 of the manual), there seem to really be three applicable ones.  Erase a 4Kb sector, erase a 64Kb sector, or bulk erase the entire memory (except the OTP space in the memory).  It sure seems it would have been useful to provide a Page erase ability (256 bytes) since pages can be written in 256-byte blocks.  But alas, it doesn't seem that is possible.  

Reading and Writing (once) to the OTP space of the memory is also well documented.  It, of course, can't be erased.

So it seems the (one?) proper way to use the memory is to...

  1. Bulk Erase the memory before using (and if you ever want to complete reset it)
  2. Program pages at a time but obviously only the first memory addresses you want to use (if they don't take a full 256-byte page)
  3. If you've programmed part of a page and want to program the rest of the page, start programming offset from the end of the page but with only a buffer sized with what remains out of the 256 bytes.
  4. If you ever want to 'overwrite' a 4Kb sector of memory, you must erase the entire sector before programming it again (so you might want to read what is there to restore any of it is desired).

Finally, the datasheet implies there are at least 100K erase/program cycles.

I attached the datasheet I was using for the memory.

Infineon-S25FL128P_128_MBIT_3.0_V_FLASH_MEMORY-DataSheet-v14_00-EN.pdf

Edited by engrpetero
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...