In reply to Jeremy:
You have set the read mode to standard :-
/* Read mode to operate the device in */#define BSP_PRV_QSPI_READ_MODE QSPI_READMODE_STANDARD //QSPI_READMODE_FAST_QUAD_IO
and the clock speed for the QSPI peripheral is set to PLCKA/2 (so 60MHz with a 120MHz PCLKA on an S7G2 device) :-
/* QSPI Clock rate */#define BSP_PRV_QSPI_CLOCK_RATE QSPI_CLK_DIV2 ///< QSPI CLK runs at 60.00 MHz if PCLKA is set to 120MHz
However, standard read mode can only be used upto 50MHz for the S25FL127S device:-
above 50MHz you will need to use the fast read command.
In reply to WedaPashi:
Also, you have set :-
/** When page program uses multiple data lines, the address is on one line. */#define QSPI_PAGE_PROGRAM_ADDRESS_ONE_LINE (0x1U)
/** When page program uses multiple data lines, the data is on 4 lines. */#define QSPI_PAGE_PROGRAM_DATA_LINES (0x4U)
This means that the page program API R_QSPI_PageProgram() will try to send the the command and the address on one data line, and the data on 4 data lines, i.e the Quad Page Program command :-
However in the initialisation, you have set the QUAD bit in the config1 register to 0 :-
flag_config1.quad = 0U; /* set bit 2 (S9), QE = 1 */
So the QPP command will not work. This is probably why the flash is reading as all 0xFF even after you attempt to program it.