Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

Questions: QSPI driver for an external flash with the nRF5 SDK 17.1, nRF52840

Hi guys,

We designed a custom board with the nRF52840 SoC and is trying to use the QSPI interface to communicate with an external flash AS5F18G04SND-10LIN.

We are having some questions here and hope to get some feedback:

1. The nRF52840 datasheet recommended the following pins for QSPI communications (aQFN73 package): p0.18 for CSN, p0.19 for SCK, p0.21, p0.23, p0.22, p1.00 for SIO. While our current design used p0.25 for CSN, p0.22 for SCK, p0.20, p0.21, p0.23, p0.24 for SIO. Is this a problem?

2. I'm trying to build the driver for the external flash we used: AS5F18G04SND-10LIN, starting from the peripheral/QSPI example from the nRF5 SDK, I'm not sure if I fully understand the example though. In the example, the application code called the nrf_drv_qspi_erase, nrf_drv_qspi_write, and nrf_drv_qspi_read functions to erase, write and read the flash. However, from the datasheet of the external flash (MX25R6435FZNIL0) used on the nRF52840 DK, a device operation should start with a command byte (for example, page program would be 0x02). I don' see how these commands are implemented in the example.

3. Can I have some top-level advice on how to build the driver for AS5F18G04SND-10LIN? Like, what should the program flow be like?

Thanks so much for your time guys!

Best,

Richard

Parents
  • Hi,

    1. We would recommend you to use the pins from the PS if possible, but other high-frequency GPIOs should work as well if you are not able to use the recommended GPIOs. See this thread for more details.

    2. The Instruction set of the QSPI peripheral is hardcoded in the HW. You need to check the datasheet of your flash device to see that it supports the same instruction set, and verify that it matches the Interface description of the QSPI peripheral. It is possible to define custom instructions, if your device needs special instructions for certain operations. 

    3. How to configure and use the QSPI driver is documented on this page.

    Best regards,
    Jørgen

  • Hi,

    Yes, that is correct. But it may not be very practical to use the QSPI peripheral in that way, so I would highly recommend you to use a flash chip that supports the same instruction set.

    Best regards,
    Jørgen

  • Hi Jørgen,

    It has been some time but I would like to follow up with this post.

    We tried to build a QSPI driver for an 8Gb flash (AS5F18G04SND-10LIN) with a different instruction set than the one hardcoded in nRF52840 QSPI module. I hope to seek your advice on this specific flash model we are using and see if it's actually feasible to build the driver based on nrfx QSPI APIs and custom instruction mode.

    We found that, during the nrfx_qspi_init, there is a function nrf_task nrf_qspi_task_trigger(NRF_QSPI, NRF_QSPI_TASK_ACTIVATE). By probing the SIO0, we see it sent 0x05 to the flash and if it does not read 0 back, it will keep sending 0x05. Since the flash we are using does not have 0x05 as read status command, the iinit will keep running and return time out error. We then are not able to proceed to send custom instructions.

    I tired to see if there is any way to get around nrf_qspi_task_trigger(NRF_QSPI, NRF_QSPI_TASK_ACTIVATE) but look like if qspi is not active, the custom instruction mode won't work either. Since sending 0x05 is seemed hardcoded, I feel that we can not use QSPI in this case.

    Can you help us review if this is the case? To still use AS5F18G04SND-10LIN, do we have to use the standard SPI mode instead?

    Thanks,

    Richard

  • Hi Jørgen, just want to make sure this post is having your attention? Or should I submit another post to ask questions?

    Thanks,

    Richard

Reply Children
Related