FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
6343 Discussions

A write memory problem via Quad SPI mode in Generic Serial Flash Interface IP

Gyud0
Beginner
441 Views

Hey,

I'm using the Reference design Generic Serial Flash Interface IP on Quartus Prime 18.1 to access Micron MT25QL512Mb flash memory.

Via NIOS processor, I'm trying to write data to this flash unsuccessfully.

I do it in this order:

1)Entering Quad SPI mode (by enter_quad_mode function).

2)Entering to 4-Byte addressing mode (by enter_4byte_addressing_mode function).

3) Enabling the writing  (by write_enable function).

4)Writing the data (by write_memory_quad function)

5) Reading the written data (by read_memory_quad function)

 

 

these are the functions:

1) void enter_quad_mode()

    IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x7,0x00000035);

IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x9,0x00000000);

IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x8,0x1);

}

 

2) void enter_4byte_addressing_mode()

    IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x7,0x000000B7);

IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x8,0x1);

IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0xA,1);

}

 

3) void write_enable()

{

 IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x7,0x00000006);

IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x8,0x1);

IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0xA,1);

}

 

 

4) void write_memory_quad()

{

 IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x4,0x00022222);

IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x0,0x101);

IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x6,7012);

IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_MEM_BASE,0x00000000,0xAA550000);

}

 

5) int read_memory_quad()

{

    IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x4,0x00022222);

    IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x0,0x00000101);

   IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x5,0x00000A0C);

    return            IORD(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_MEM_BASE,0x00000000);

}

 

 

I'm using the function usleep(1000000) between each function I'm operating.

 

The received data (after I'm using the read_memory_quad function) is 0 instead of 0xAA550000. 

 

 

this is the Device's datasheet (page 37):

https://media-www.micron.com/-/media/client/global/documents/products/data-sheet/nor-flash/serial-no...

 

I would like to get some help here,

Thanks

0 Kudos
4 Replies
Gyud0
Beginner
419 Views

Can you help me please?

0 Kudos
EBERLAZARE_I_Intel
388 Views

Hi,


Did you use this design?:

https://www.intel.com/content/www/us/en/docs/programmable/683689/current/processor-booting-from-qspi-flash.html


If not could you re-try using the above design, and let me know if the same issue occurs\.


0 Kudos
Kenny_Tan
Moderator
378 Views

Not sure if you have update on this? Kindly expect some late reply as the owner is taking some leave until next week.



0 Kudos
EBERLAZARE_I_Intel
364 Views

Hi,


Any update from your side?


0 Kudos
Reply