Baremetal application to read and write on qspi flash of DE0-NANO-SOC


I am new developer for the Cyclone v SoC.

I want to read and write from the QSPI flash in my HPS baremetal application. I want to write a very simple data in words format.
write data 0xABCD, 0xCDEF, 0x1234
and then read it back.

I checked the following functions but they are not working for me.

I think i need to initialize the qspi and do the other initialization etc before using alt_qspi_write or alt_qspi_read.

Is there any one who developed a c program for QSPI of DE0-NANO-SOC?
is there any built application project doing the simple read and write on QSPI?

Make sure that you are also calling alt_qspi_init() and then alt_qspi_enable() functions from Altera hwlibs. You need to call them to “discover” your memory chip first.