cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
583 Views
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:

:10000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00
:10001000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0
:10002000000000BB11220044FFFFFFFFFFFFFFFFA6
:10003000AA995566200000003003E0010000000B83
:10004000300080010000001220000000300220017A
:1000500000000000300200010000000030008001BC
:1000600000000000200000003000800100000007B8
:1000700020000000200000003002600100000000AD
:100080003001200102003FE53001C0010000000006
:10009000300180010364709330008001000000098A
:1000A000200000003000C001000004013000A00169
:1000B000000005013000C001000000003003000115
:1000C00000000000200000002000000020000000D0
:1000D00020000000200000002000000020000000A0
:1000E00020000000300020010000000030008001EE
:1000F000000000012000000030004000500B7A7822

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:

0x7E5FE192BEAEF6F6EAA85F6D56CE413A

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
Highlighted
Moderator
Moderator
535 Views
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) https://www.xilinx.com/support/documentation/sw_manuals/xilinx2018_2/ug908-vivado-programming-debugging.pdf

Thanks
Harshit
-------------------------------------------------------------------------------------
For more information please refer to configuration resources https://forums.xilinx.com/t5/FPGA-Configuration/Configuration-Resources/m-p/753763/highlight/true#M5891
-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
501 Views
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.

Regards,
Bhushan

-------------------------------------------------------------------------------------------------------------------------------------------------
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