Showing results for 
Show  only  | Search instead for 
Did you mean: 
Registered: ‎12-01-2017

Read SPI Flash through RTL

I have programmed SPI Flash (M25P64) with .mcs using impact

Now my application requires to read that flash contents and do some manipulation over it.

am doing it by sending the read instruction (0x03 followed by 24-bit sector address). but the contents read are in different format

In the first page of first sector, there resides configuration data and it as follows:


data highlighted in green are the actual contents

when I read this from FPGA, the data that comes from MISO of Flash is as follows

Dummy Bite(mostly 0x00), 0xFF(32 bytes), 00, 00, BB, 00, 22, 11, 44, 00, 0xFF(8 bytes), 99, AA, 66, 55, 00, 20 ..........

where it has to be actually read like this:

0xFF(32 bytes), 00, 00, 00, BB, 11, 22, 44, 00, 0xFF(8 bytes), AA, 99, 55, 66......





and even I tried writing some fixed value to some sector through impact using non-configuration data file option:

suppose in last sector I wrote:


It has been read as foolows:

Dummy Bite(0x08), 5F, 7E, 92, E1, AE, BE, F6, F6, A8, EA, 6D, 5F, CE, 56, 3A, 41

on MISO:

00001000 01011111 01111110 10010010 11100001 10101110 10111110 11110110 11110110 10101000..........

where as the expected one is:

7E, 5F, E1, 92, BE, AE, F6, F6, EA, A8, 5F, 6D, 56, CE, 41, 3A

on MISO:

01111110 01011111 11100001 10010010 10111110 10101110 11110110 11110110 11101010 10101000......



Actually it has been read in the required format but in one particular hardware, its been read wrongly thats in different format as i mentioned.To read the data in the required format, is there any setting s to be changed or any hardware modification to be done.

Looking for the solution asap.

0 Kudos
2 Replies
Registered: ‎06-05-2013

You can use vivado for performing the flash readback. It seems you are using Kintex 7 from the above details. For more details on the readback please refer to UG#908 (Page#65)

For more information please refer to configuration resources
Don’t forget to reply, kudo, and accept as solution.
0 Kudos
Xilinx Employee
Xilinx Employee
Registered: ‎03-07-2018

Hi @lakshmitejaswi

You can access configuration SPI Flash using STARTUP3 primitive (for ultrascale FPGAs) after FPGA configuration.

Check XAPP1280 (v1.1) for more details.


Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos