Forum Discussion
A read memory problem via Quad SPI mode in Generic Serial Flash Interface IP
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 able to read the memory data correctly in the single SPI mode by the function:
int read_memory()
{
IOWR(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_CSR_BASE,0x4,0x00000000);
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,0x00000003);
return IORD(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_MEM_BASE,0x00000000);
}
But when I'm trying to read the data in Quad SPI mode, I always got x"FFFF":
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,0x00000A0B);
return IORD(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_MEM_BASE,0x00000000);
}
this is the Device's datasheet (page 37):
I would like to get some help here,
Thanks
5 Replies
- MathiasB
Occasional Contributor
Hi,
From your read_memory_quad function, it seems that you are configuring the IP but not the component. For instance, you set the IP to behave as Quad IO and 4-bytes adressing, but you also need to set the registers of the component. Or do you do this in another function prior to this one?
- Gyud0
Occasional Contributor
I indeed configure the IP as 4-byte addressing and then read the data by read_memory_quad function (CSR region)
I don't understand the registers you are talking about.
- MathiasB
Occasional Contributor
I was refering to the configuration registers on page 24 of the datasheet. Don't you need to set them in order to enable Quad mode for instance?