I am developing an application on a S7G2 Custom board.
I need the QSPI Flash interface for using an external flash memory.
The microcontroller part number: R7FS7G27H3A01CFB
Ext. Flash part number: S25FL127SABMFI101
I am in process of creating the custom BSP for the custom board.
The problem I am facing is that,
g_qspi0.p_api->open(g_qspi0.p_ctrl, g_qspi0.p_cfg);
I have read through the following posts that are relevant.
Despite reading all of them, I don't see what all changes are required to get the QSPI Flash interface functional.
Any help is appreciated.
  • In reply to Jeremy:

    You have set the read mode to standard :-

    /* Read mode to operate the device in */


    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 Jeremy:

    : Hi, thanks for responding. I have confirmed that the QSPI pins are correctly configured in Synergy Pin Configuration. And, may be it is correct as I can read manufacturer ID, memory interface type and memory capacity/density correctly. Those values match with what flash datasheet says. I have contacted the flash manufacturer (cypress) for initialization steps for this part but I have not received a response. I haven't seen a post here on renensasrulz which claims to have got the S25FL127S flash working.

    Will it be possible for you to check the initialization steps that I have followed?
  • In reply to WedaPashi:

    Also, you have set :-

    /** When page program uses multiple data lines, the address is on one line. */

    /** 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.

  • In reply to Jeremy:

    : I tried the changes you suggested, still reads all oxFFs. Is there possibility to interface this chip with the conventional SPI mode by selecting Single or Dual mode in pin configuration? If yes, what all changes in bsp_qspi.c and bsp_qspi.h?