This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

QSPI: problems with a MX25R1635F or how to initialize the port pins?

Hi

data sheet of the nRF52840 states that the QSPI port pins should be initialized to "high drive".

I've experimented a little bit because I have problems with a Macronix Flash (MX25R1635F) which does not reliably work.  The DK-Chip from Macronix (MX25R6435F) is not a problem with the same firmware and a flash from OnSemi (LE25S161) works on our hardware as well.

To make the story short: I can do RDID of the MX25R1635F, but reading the status/config register of the MX25R1635F always shows zero.  Erasing also does not work.  The OnSemi works without problems.

I've already used all different SPI read/write modes, no success.  I've also tried to init the port pins with pullup.  Not a good idea, because the program than hangs.

So the question: how to setup the QSPI port pins properly?

Thanks & regards

Hardy

  • Replying to myself: I guess that the following could be a problem:

    #define NRFX_QSPI_DEFAULT_CINSTR(opc, len) \
    {                                          \
        .opcode    = (opc),                    \
        .length    = (len),                    \
        .io2_level = false,                    \
        .io3_level = false,                    \
        .wipwait   = false,                    \
        .wren      = false                     \
    }

    This is used e.g. in nrfx_qspi_mem_busy_check().

    The Macronix has two different modes.  In one IO3 and IO4 are HOLD# and RESET#, in the other those are IOs (QEN).

    Problem seems that one has to really put the Macronix into the QEN mode before all is working.

    So still two question:

    • how to init the QSPI port pins?
    • is there any special reason, why io3_level/io4_level are set to "0"?

    Regards

    Hardy

  • Hi Hardy

    Which pins are you using on your hardware for QSPI? The QSPI peripheral example should show you how the default QSPI pins are configured (in nrf_drv_qspi.h and pca10056.h), and it shouldn't be required to do anything more than edit the QSPI_PIN defines  to what GPIOs you'd like, however it's recommended not to use the ones that are recommended for low frequency and standard drive pins in the pin assignments of the nRF52840 PS.

    Best regards,

    Simon

  • Hi Simon

    following definitions:

    #define EXT_FLASH_CS       NRF_GPIO_PIN_MAP(0,17)
    #define EXT_FLASH_SCK      NRF_GPIO_PIN_MAP(0,19)
    #define EXT_FLASH_IO0      NRF_GPIO_PIN_MAP(0,20)
    #define EXT_FLASH_IO1      NRF_GPIO_PIN_MAP(0,21)
    #define EXT_FLASH_IO2      NRF_GPIO_PIN_MAP(0,22)
    #define EXT_FLASH_IO3      NRF_GPIO_PIN_MAP(0,23)

    So I expect we are safe in this.  Perhaps I´m too stupid, bu I cannot find the actual port initialization..

    Do you have a pointer for me please.

    Regards

    Hardy

  • Hi Hardy

    What SDK are you using? Any of the nRF5 SDKs, or the nRFConnect SDK (NCS)? Please check out the nrfx_qspi.c/h driver files to see how the pins are initialized in the QSPI driver (qspi_pins_configure() function).  These driver files can be found at \...\SDK_FOLDER\modules\nrfx\drivers\src\nrfx_qspi.c

    Best regards,

    Simon

  • Hi Simon

    I'm using SDK 15.2, sorry for not mentioning this before.  qspi_pins_configure() does not make the actual port init (at least in my version).  I´m talking about the pin setup like this:

    nrf_gpio_cfg(
                    pin,
                    NRF_GPIO_PIN_DIR_INPUT,
                    NRF_GPIO_PIN_INPUT_DISCONNECT,
                    NRF_GPIO_PIN_NOPULL,
                    NRF_GPIO_PIN_H0H1,
                    NRF_GPIO_PIN_NOSENSE);

    I'm asking because the PS mentions that the pins should be set to high current.

    Regards

    Hardy

Related