Forum Discussion
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?
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.
- MathiasB4 years ago
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?
- Gyud04 years ago
Occasional Contributor
Can you guide me how I have to set that thing?
- MathiasB4 years ago
Occasional Contributor
Actually, I think you must have done it at some point, because otherwise the QSPI's register bit 0 (addressing mode) would be 3-bytes (default value) while you have configured the IP as 4-bytes. And this is also true for the first, Single IO read function: in my opinion, it should not work (I may be mistaken).
On a side note, you might not have to do all the steps below if instead of FAST READ you use the 4 BYTE QUAD (INPUT) OUTPUT FAST READ command(s).
Putting that aside, to address any configuration or status register of a QSPI with the GSFI IP, you need to use the CSR register 0x7. There is a number of fields in this register that you need to configure depending on the command you want to use:
1) you need to to a Write Enable to modify configuration register (Opcode = 0x06). You can IOWR 0x06 to register 7, for this one.
2) you need to write the configuration register itself, either with WRITE VOLATILE (Opcode = 0x81) or WRITE NON VOLATILE (Opcode = 0xB1). You need to set the number of data bytes to either 1 or 2, depending on the command, in register 7. You put the data you want to write in the 0xA/0xB registers of the IP.
3) (optionnally) if you use WRITE NON VOLATILE, the datasheet states that you need to poll the STATUS REGISTER or FLAG STATUS REGISTER until completion. That means you need to change register 7 once more according to the READ (FLAG) STATUS REGISTER Opcode. The read back data will be in the 0xC/0xD registers.
Hope it can help to solve your problem!